{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "    \u003cdiv class\u003d\"bk-root\"\u003e\n",
              "        \u003ca href\u003d\"https://bokeh.pydata.org\" target\u003d\"_blank\" class\u003d\"bk-logo bk-logo-small bk-logo-notebook\"\u003e\u003c/a\u003e\n",
              "        \u003cspan id\u003d\"1001\"\u003eLoading BokehJS ...\u003c/span\u003e\n",
              "    \u003c/div\u003e"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "\n",
              "(function(root) {\n",
              "  function now() {\n",
              "    return new Date();\n",
              "  }\n",
              "\n",
              "  var force \u003d true;\n",
              "\n",
              "  if (typeof (root._bokeh_onload_callbacks) \u003d\u003d\u003d \"undefined\" || force \u003d\u003d\u003d true) {\n",
              "    root._bokeh_onload_callbacks \u003d [];\n",
              "    root._bokeh_is_loading \u003d undefined;\n",
              "  }\n",
              "\n",
              "  var JS_MIME_TYPE \u003d \u0027application/javascript\u0027;\n",
              "  var HTML_MIME_TYPE \u003d \u0027text/html\u0027;\n",
              "  var EXEC_MIME_TYPE \u003d \u0027application/vnd.bokehjs_exec.v0+json\u0027;\n",
              "  var CLASS_NAME \u003d \u0027output_bokeh rendered_html\u0027;\n",
              "\n",
              "  /**\n",
              "   * Render data to the DOM node\n",
              "   */\n",
              "  function render(props, node) {\n",
              "    var script \u003d document.createElement(\"script\");\n",
              "    node.appendChild(script);\n",
              "  }\n",
              "\n",
              "  /**\n",
              "   * Handle when an output is cleared or removed\n",
              "   */\n",
              "  function handleClearOutput(event, handle) {\n",
              "    var cell \u003d handle.cell;\n",
              "\n",
              "    var id \u003d cell.output_area._bokeh_element_id;\n",
              "    var server_id \u003d cell.output_area._bokeh_server_id;\n",
              "    // Clean up Bokeh references\n",
              "    if (id !\u003d null \u0026\u0026 id in Bokeh.index) {\n",
              "      Bokeh.index[id].model.document.clear();\n",
              "      delete Bokeh.index[id];\n",
              "    }\n",
              "\n",
              "    if (server_id !\u003d\u003d undefined) {\n",
              "      // Clean up Bokeh references\n",
              "      var cmd \u003d \"from bokeh.io.state import curstate; print(curstate().uuid_to_server[\u0027\" + server_id + \"\u0027].get_sessions()[0].document.roots[0]._id)\";\n",
              "      cell.notebook.kernel.execute(cmd, {\n",
              "        iopub: {\n",
              "          output: function(msg) {\n",
              "            var id \u003d msg.content.text.trim();\n",
              "            if (id in Bokeh.index) {\n",
              "              Bokeh.index[id].model.document.clear();\n",
              "              delete Bokeh.index[id];\n",
              "            }\n",
              "          }\n",
              "        }\n",
              "      });\n",
              "      // Destroy server and session\n",
              "      var cmd \u003d \"import bokeh.io.notebook as ion; ion.destroy_server(\u0027\" + server_id + \"\u0027)\";\n",
              "      cell.notebook.kernel.execute(cmd);\n",
              "    }\n",
              "  }\n",
              "\n",
              "  /**\n",
              "   * Handle when a new output is added\n",
              "   */\n",
              "  function handleAddOutput(event, handle) {\n",
              "    var output_area \u003d handle.output_area;\n",
              "    var output \u003d handle.output;\n",
              "\n",
              "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
              "    if ((output.output_type !\u003d \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
              "      return\n",
              "    }\n",
              "\n",
              "    var toinsert \u003d output_area.element.find(\".\" + CLASS_NAME.split(\u0027 \u0027)[0]);\n",
              "\n",
              "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !\u003d\u003d undefined) {\n",
              "      toinsert[toinsert.length - 1].firstChild.textContent \u003d output.data[JS_MIME_TYPE];\n",
              "      // store reference to embed id on output_area\n",
              "      output_area._bokeh_element_id \u003d output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
              "    }\n",
              "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !\u003d\u003d undefined) {\n",
              "      var bk_div \u003d document.createElement(\"div\");\n",
              "      bk_div.innerHTML \u003d output.data[HTML_MIME_TYPE];\n",
              "      var script_attrs \u003d bk_div.children[0].attributes;\n",
              "      for (var i \u003d 0; i \u003c script_attrs.length; i++) {\n",
              "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
              "      }\n",
              "      // store reference to server id on output_area\n",
              "      output_area._bokeh_server_id \u003d output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
              "    }\n",
              "  }\n",
              "\n",
              "  function register_renderer(events, OutputArea) {\n",
              "\n",
              "    function append_mime(data, metadata, element) {\n",
              "      // create a DOM node to render to\n",
              "      var toinsert \u003d this.create_output_subarea(\n",
              "        metadata,\n",
              "        CLASS_NAME,\n",
              "        EXEC_MIME_TYPE\n",
              "      );\n",
              "      this.keyboard_manager.register_events(toinsert);\n",
              "      // Render to node\n",
              "      var props \u003d {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
              "      render(props, toinsert[toinsert.length - 1]);\n",
              "      element.append(toinsert);\n",
              "      return toinsert\n",
              "    }\n",
              "\n",
              "    /* Handle when an output is cleared or removed */\n",
              "    events.on(\u0027clear_output.CodeCell\u0027, handleClearOutput);\n",
              "    events.on(\u0027delete.Cell\u0027, handleClearOutput);\n",
              "\n",
              "    /* Handle when a new output is added */\n",
              "    events.on(\u0027output_added.OutputArea\u0027, handleAddOutput);\n",
              "\n",
              "    /**\n",
              "     * Register the mime type and append_mime function with output_area\n",
              "     */\n",
              "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
              "      /* Is output safe? */\n",
              "      safe: true,\n",
              "      /* Index of renderer in `output_area.display_order` */\n",
              "      index: 0\n",
              "    });\n",
              "  }\n",
              "\n",
              "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
              "  if (root.Jupyter !\u003d\u003d undefined) {\n",
              "    var events \u003d require(\u0027base/js/events\u0027);\n",
              "    var OutputArea \u003d require(\u0027notebook/js/outputarea\u0027).OutputArea;\n",
              "\n",
              "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) \u003d\u003d -1) {\n",
              "      register_renderer(events, OutputArea);\n",
              "    }\n",
              "  }\n",
              "\n",
              "  \n",
              "  if (typeof (root._bokeh_timeout) \u003d\u003d\u003d \"undefined\" || force \u003d\u003d\u003d true) {\n",
              "    root._bokeh_timeout \u003d Date.now() + 5000;\n",
              "    root._bokeh_failed_load \u003d false;\n",
              "  }\n",
              "\n",
              "  var NB_LOAD_WARNING \u003d {\u0027data\u0027: {\u0027text/html\u0027:\n",
              "     \"\u003cdiv style\u003d\u0027background-color: #fdd\u0027\u003e\\n\"+\n",
              "     \"\u003cp\u003e\\n\"+\n",
              "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
              "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
              "     \"\u003c/p\u003e\\n\"+\n",
              "     \"\u003cul\u003e\\n\"+\n",
              "     \"\u003cli\u003ere-rerun `output_notebook()` to attempt to load from CDN again, or\u003c/li\u003e\\n\"+\n",
              "     \"\u003cli\u003euse INLINE resources instead, as so:\u003c/li\u003e\\n\"+\n",
              "     \"\u003c/ul\u003e\\n\"+\n",
              "     \"\u003ccode\u003e\\n\"+\n",
              "     \"from bokeh.resources import INLINE\\n\"+\n",
              "     \"output_notebook(resources\u003dINLINE)\\n\"+\n",
              "     \"\u003c/code\u003e\\n\"+\n",
              "     \"\u003c/div\u003e\"}};\n",
              "\n",
              "  function display_loaded() {\n",
              "    var el \u003d document.getElementById(\"1001\");\n",
              "    if (el !\u003d null) {\n",
              "      el.textContent \u003d \"BokehJS is loading...\";\n",
              "    }\n",
              "    if (root.Bokeh !\u003d\u003d undefined) {\n",
              "      if (el !\u003d null) {\n",
              "        el.textContent \u003d \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
              "      }\n",
              "    } else if (Date.now() \u003c root._bokeh_timeout) {\n",
              "      setTimeout(display_loaded, 100)\n",
              "    }\n",
              "  }\n",
              "\n",
              "\n",
              "  function run_callbacks() {\n",
              "    try {\n",
              "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
              "    }\n",
              "    finally {\n",
              "      delete root._bokeh_onload_callbacks\n",
              "    }\n",
              "    console.info(\"Bokeh: all callbacks have finished\");\n",
              "  }\n",
              "\n",
              "  function load_libs(js_urls, callback) {\n",
              "    root._bokeh_onload_callbacks.push(callback);\n",
              "    if (root._bokeh_is_loading \u003e 0) {\n",
              "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
              "      return null;\n",
              "    }\n",
              "    if (js_urls \u003d\u003d null || js_urls.length \u003d\u003d\u003d 0) {\n",
              "      run_callbacks();\n",
              "      return null;\n",
              "    }\n",
              "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
              "    root._bokeh_is_loading \u003d js_urls.length;\n",
              "    for (var i \u003d 0; i \u003c js_urls.length; i++) {\n",
              "      var url \u003d js_urls[i];\n",
              "      var s \u003d document.createElement(\u0027script\u0027);\n",
              "      s.src \u003d url;\n",
              "      s.async \u003d false;\n",
              "      s.onreadystatechange \u003d s.onload \u003d function() {\n",
              "        root._bokeh_is_loading--;\n",
              "        if (root._bokeh_is_loading \u003d\u003d\u003d 0) {\n",
              "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
              "          run_callbacks()\n",
              "        }\n",
              "      };\n",
              "      s.onerror \u003d function() {\n",
              "        console.warn(\"failed to load library \" + url);\n",
              "      };\n",
              "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
              "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
              "    }\n",
              "  };var element \u003d document.getElementById(\"1001\");\n",
              "  if (element \u003d\u003d null) {\n",
              "    console.log(\"Bokeh: ERROR: autoload.js configured with elementid \u00271001\u0027 but no matching script tag was found. \")\n",
              "    return false;\n",
              "  }\n",
              "\n",
              "  var js_urls \u003d [\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.0.4.min.js\"];\n",
              "\n",
              "  var inline_js \u003d [\n",
              "    function(Bokeh) {\n",
              "      Bokeh.set_log_level(\"info\");\n",
              "    },\n",
              "    \n",
              "    function(Bokeh) {\n",
              "      \n",
              "    },\n",
              "    function(Bokeh) {\n",
              "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.css\");\n",
              "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.css\");\n",
              "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.css\");\n",
              "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.css\");\n",
              "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.css\");\n",
              "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.css\");\n",
              "    }\n",
              "  ];\n",
              "\n",
              "  function run_inline_js() {\n",
              "    \n",
              "    if ((root.Bokeh !\u003d\u003d undefined) || (force \u003d\u003d\u003d true)) {\n",
              "      for (var i \u003d 0; i \u003c inline_js.length; i++) {\n",
              "        inline_js[i].call(root, root.Bokeh);\n",
              "      }if (force \u003d\u003d\u003d true) {\n",
              "        display_loaded();\n",
              "      }} else if (Date.now() \u003c root._bokeh_timeout) {\n",
              "      setTimeout(run_inline_js, 100);\n",
              "    } else if (!root._bokeh_failed_load) {\n",
              "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
              "      root._bokeh_failed_load \u003d true;\n",
              "    } else if (force !\u003d\u003d true) {\n",
              "      var cell \u003d $(document.getElementById(\"1001\")).parents(\u0027.cell\u0027).data().cell;\n",
              "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
              "    }\n",
              "\n",
              "  }\n",
              "\n",
              "  if (root._bokeh_is_loading \u003d\u003d\u003d 0) {\n",
              "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
              "    run_inline_js();\n",
              "  } else {\n",
              "    load_libs(js_urls, function() {\n",
              "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
              "      run_inline_js();\n",
              "    });\n",
              "  }\n",
              "}(window));"
            ],
            "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force \u003d true;\n\n  if (typeof (root._bokeh_onload_callbacks) \u003d\u003d\u003d \"undefined\" || force \u003d\u003d\u003d true) {\n    root._bokeh_onload_callbacks \u003d [];\n    root._bokeh_is_loading \u003d undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) \u003d\u003d\u003d \"undefined\" || force \u003d\u003d\u003d true) {\n    root._bokeh_timeout \u003d Date.now() + 5000;\n    root._bokeh_failed_load \u003d false;\n  }\n\n  var NB_LOAD_WARNING \u003d {\u0027data\u0027: {\u0027text/html\u0027:\n     \"\u003cdiv style\u003d\u0027background-color: #fdd\u0027\u003e\\n\"+\n     \"\u003cp\u003e\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"\u003c/p\u003e\\n\"+\n     \"\u003cul\u003e\\n\"+\n     \"\u003cli\u003ere-rerun `output_notebook()` to attempt to load from CDN again, or\u003c/li\u003e\\n\"+\n     \"\u003cli\u003euse INLINE resources instead, as so:\u003c/li\u003e\\n\"+\n     \"\u003c/ul\u003e\\n\"+\n     \"\u003ccode\u003e\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources\u003dINLINE)\\n\"+\n     \"\u003c/code\u003e\\n\"+\n     \"\u003c/div\u003e\"}};\n\n  function display_loaded() {\n    var el \u003d document.getElementById(\"1001\");\n    if (el !\u003d null) {\n      el.textContent \u003d \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !\u003d\u003d undefined) {\n      if (el !\u003d null) {\n        el.textContent \u003d \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() \u003c root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n    }\n    finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.info(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(js_urls, callback) {\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading \u003e 0) {\n      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls \u003d\u003d null || js_urls.length \u003d\u003d\u003d 0) {\n      run_callbacks();\n      return null;\n    }\n    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading \u003d js_urls.length;\n    for (var i \u003d 0; i \u003c js_urls.length; i++) {\n      var url \u003d js_urls[i];\n      var s \u003d document.createElement(\u0027script\u0027);\n      s.src \u003d url;\n      s.async \u003d false;\n      s.onreadystatechange \u003d s.onload \u003d function() {\n        root._bokeh_is_loading--;\n        if (root._bokeh_is_loading \u003d\u003d\u003d 0) {\n          console.log(\"Bokeh: all BokehJS libraries loaded\");\n          run_callbacks()\n        }\n      };\n      s.onerror \u003d function() {\n        console.warn(\"failed to load library \" + url);\n      };\n      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.getElementsByTagName(\"head\")[0].appendChild(s);\n    }\n  };var element \u003d document.getElementById(\"1001\");\n  if (element \u003d\u003d null) {\n    console.log(\"Bokeh: ERROR: autoload.js configured with elementid \u00271001\u0027 but no matching script tag was found. \")\n    return false;\n  }\n\n  var js_urls \u003d [\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.0.4.min.js\"];\n\n  var inline_js \u003d [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    \n    function(Bokeh) {\n      \n    },\n    function(Bokeh) {\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.4.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.4.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.4.min.css\");\n    }\n  ];\n\n  function run_inline_js() {\n    \n    if ((root.Bokeh !\u003d\u003d undefined) || (force \u003d\u003d\u003d true)) {\n      for (var i \u003d 0; i \u003c inline_js.length; i++) {\n        inline_js[i].call(root, root.Bokeh);\n      }if (force \u003d\u003d\u003d true) {\n        display_loaded();\n      }} else if (Date.now() \u003c root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load \u003d true;\n    } else if (force !\u003d\u003d true) {\n      var cell \u003d $(document.getElementById(\"1001\")).parents(\u0027.cell\u0027).data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading \u003d\u003d\u003d 0) {\n    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(js_urls, function() {\n      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": "# bokeh dash demo: https://github.com/bokeh/bokeh/tree/master/examples/app/dash\n\nimport numpy as np\nfrom bokeh.io import output_notebook, show\nfrom bokeh.plotting import figure\nfrom bokeh.sampledata.autompg import autompg as df\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.palettes import Spectral6\n\n# load bokeh\noutput_notebook()"
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"0b740725-ac79-4cec-b6c8-9f38791b8c8c\" data-root-id\u003d\"1039\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"b56994a4-c628-4274-9226-14d866f04c47\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1049\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1054\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1049\",\"type\":\"LinearAxis\"},{\"id\":\"1053\",\"type\":\"Grid\"},{\"id\":\"1054\",\"type\":\"LinearAxis\"},{\"id\":\"1058\",\"type\":\"Grid\"},{\"id\":\"1067\",\"type\":\"BoxAnnotation\"},{\"id\":\"1077\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1038\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1065\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1041\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1045\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1043\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1047\",\"type\":\"LinearScale\"}},\"id\":\"1039\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1039\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1055\",\"type\":\"BasicTicker\"}},\"id\":\"1058\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1076\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1086\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"blue\"},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1075\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1059\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1083\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1060\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1067\",\"type\":\"BoxAnnotation\"}},\"id\":\"1061\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u5706\\u5f62\\u6563\\u70b9\"},\"id\":\"1038\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1062\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1063\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1041\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1086\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1085\",\"type\":\"UnionRenderers\"}},\"id\":\"1074\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1081\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1064\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1043\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1059\",\"type\":\"PanTool\"},{\"id\":\"1060\",\"type\":\"WheelZoomTool\"},{\"id\":\"1061\",\"type\":\"BoxZoomTool\"},{\"id\":\"1062\",\"type\":\"SaveTool\"},{\"id\":\"1063\",\"type\":\"ResetTool\"},{\"id\":\"1064\",\"type\":\"HelpTool\"}]},\"id\":\"1065\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1045\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"1074\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1075\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1076\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1078\",\"type\":\"CDSView\"}},\"id\":\"1077\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1047\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1067\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"1083\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1039\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1050\",\"type\":\"BasicTicker\"}},\"id\":\"1049\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"1074\",\"type\":\"ColumnDataSource\"}},\"id\":\"1078\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1085\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1050\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"1039\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1050\",\"type\":\"BasicTicker\"}},\"id\":\"1053\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1081\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1039\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1055\",\"type\":\"BasicTicker\"}},\"id\":\"1054\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1055\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"1039\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"b56994a4-c628-4274-9226-14d866f04c47\",\"roots\":{\"1039\":\"0b740725-ac79-4cec-b6c8-9f38791b8c8c\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "1039"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# 圆形散点\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027圆形散点图\u0027)\n",
        "p.circle(x, y, size\u003d10, line_color\u003d\u0027navy\u0027, fill_color\u003d\u0027blue\u0027, fill_alpha\u003d0.5)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"156ad46c-c84c-4414-9968-90e81c588333\" data-root-id\u003d\"1136\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"a86ff977-dd33-450b-8bd9-509d01d07a74\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1146\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1151\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1146\",\"type\":\"LinearAxis\"},{\"id\":\"1150\",\"type\":\"Grid\"},{\"id\":\"1151\",\"type\":\"LinearAxis\"},{\"id\":\"1155\",\"type\":\"Grid\"},{\"id\":\"1164\",\"type\":\"BoxAnnotation\"},{\"id\":\"1174\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1135\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1162\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1138\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1142\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1140\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1144\",\"type\":\"LinearScale\"}},\"id\":\"1136\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.6},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1172\",\"type\":\"Square\"},{\"attributes\":{\"callback\":null},\"id\":\"1138\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u65b9\\u5f62\\u6563\\u70b9\"},\"id\":\"1135\",\"type\":\"Title\"},{\"attributes\":{\"overlay\":{\"id\":\"1164\",\"type\":\"BoxAnnotation\"}},\"id\":\"1158\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1157\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1159\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1186\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"size\":[10,15,20,25,30],\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1191\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1190\",\"type\":\"UnionRenderers\"}},\"id\":\"1171\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1171\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1172\",\"type\":\"Square\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1173\",\"type\":\"Square\"},\"selection_glyph\":null,\"view\":{\"id\":\"1175\",\"type\":\"CDSView\"}},\"id\":\"1174\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1156\",\"type\":\"PanTool\"},{\"id\":\"1157\",\"type\":\"WheelZoomTool\"},{\"id\":\"1158\",\"type\":\"BoxZoomTool\"},{\"id\":\"1159\",\"type\":\"SaveTool\"},{\"id\":\"1160\",\"type\":\"ResetTool\"},{\"id\":\"1161\",\"type\":\"HelpTool\"}]},\"id\":\"1162\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1161\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1140\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1191\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1147\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1160\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1188\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1136\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1147\",\"type\":\"BasicTicker\"}},\"id\":\"1146\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1188\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1171\",\"type\":\"ColumnDataSource\"}},\"id\":\"1175\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1144\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1164\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1142\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1173\",\"type\":\"Square\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1136\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1152\",\"type\":\"BasicTicker\"}},\"id\":\"1155\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1152\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1190\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"formatter\":{\"id\":\"1186\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1136\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1152\",\"type\":\"BasicTicker\"}},\"id\":\"1151\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"1136\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1147\",\"type\":\"BasicTicker\"}},\"id\":\"1150\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1156\",\"type\":\"PanTool\"}],\"root_ids\":[\"1136\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"a86ff977-dd33-450b-8bd9-509d01d07a74\",\"roots\":{\"1136\":\"156ad46c-c84c-4414-9968-90e81c588333\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "1136"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# 方形散点\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027方形散点图\u0027)\n",
        "p.square(x, y, size\u003d[10, 15, 20, 25, 30], color\u003d\u0027firebrick\u0027, alpha\u003d0.6)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"79b788e2-b79f-4f8d-a261-edb167226e32\" data-root-id\u003d\"1604\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"71848a9f-7a8a-4fb8-8d55-5ebc27008d26\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1614\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1619\",\"type\":\"LinearAxis\"}],\"outline_line_alpha\":{\"value\":0.3},\"outline_line_color\":{\"value\":\"navy\"},\"outline_line_width\":{\"value\":3},\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1614\",\"type\":\"LinearAxis\"},{\"id\":\"1618\",\"type\":\"Grid\"},{\"id\":\"1619\",\"type\":\"LinearAxis\"},{\"id\":\"1623\",\"type\":\"Grid\"},{\"id\":\"1632\",\"type\":\"BoxAnnotation\"},{\"id\":\"1642\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1603\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1630\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1606\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1610\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1608\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1612\",\"type\":\"LinearScale\"}},\"id\":\"1604\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1641\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"1639\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1640\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1641\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1643\",\"type\":\"CDSView\"}},\"id\":\"1642\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1624\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1625\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1606\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"1632\",\"type\":\"BoxAnnotation\"}},\"id\":\"1626\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1627\",\"type\":\"SaveTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u5e26\\u8fb9\\u6846\\u7684\\u56fe\"},\"id\":\"1603\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1628\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1686\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1604\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1620\",\"type\":\"BasicTicker\"}},\"id\":\"1619\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1640\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1629\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1610\",\"type\":\"LinearScale\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1624\",\"type\":\"PanTool\"},{\"id\":\"1625\",\"type\":\"WheelZoomTool\"},{\"id\":\"1626\",\"type\":\"BoxZoomTool\"},{\"id\":\"1627\",\"type\":\"SaveTool\"},{\"id\":\"1628\",\"type\":\"ResetTool\"},{\"id\":\"1629\",\"type\":\"HelpTool\"}]},\"id\":\"1630\",\"type\":\"Toolbar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1632\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"1688\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1604\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1615\",\"type\":\"BasicTicker\"}},\"id\":\"1614\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"1608\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1690\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1604\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1620\",\"type\":\"BasicTicker\"}},\"id\":\"1623\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1615\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"1639\",\"type\":\"ColumnDataSource\"}},\"id\":\"1643\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":{\"id\":\"1604\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1615\",\"type\":\"BasicTicker\"}},\"id\":\"1618\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1688\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1620\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1691\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1686\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1612\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1691\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1690\",\"type\":\"UnionRenderers\"}},\"id\":\"1639\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1604\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"71848a9f-7a8a-4fb8-8d55-5ebc27008d26\",\"roots\":{\"1604\":\"79b788e2-b79f-4f8d-a261-edb167226e32\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "1604"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# 带边框的散点\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027带边框的图\u0027)\n",
        "p.outline_line_width \u003d 3\n",
        "p.outline_line_alpha \u003d 0.3\n",
        "p.outline_line_color \u003d \u0027navy\u0027\n",
        "\n",
        "p.circle(x, y, size\u003d10)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"492b2b75-5c9a-4dcd-ac51-a9b103888d56\" data-root-id\u003d\"1777\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"c779994c-34bb-4a6e-94d2-641b31d1828e\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1787\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1792\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1787\",\"type\":\"LinearAxis\"},{\"id\":\"1791\",\"type\":\"Grid\"},{\"id\":\"1792\",\"type\":\"LinearAxis\"},{\"id\":\"1796\",\"type\":\"Grid\"},{\"id\":\"1805\",\"type\":\"BoxAnnotation\"},{\"id\":\"1815\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1776\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1803\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1779\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1783\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1781\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1785\",\"type\":\"LinearScale\"}},\"id\":\"1777\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"formatter\":{\"id\":\"1867\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1777\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1793\",\"type\":\"BasicTicker\"}},\"id\":\"1792\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"1779\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1793\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1777\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1793\",\"type\":\"BasicTicker\"}},\"id\":\"1796\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"1781\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1814\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"firebrick\"},\"line_dash\":[5,1],\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1813\",\"type\":\"Circle\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u8bbe\\u7f6e\\u76ee\\u6807\\u70b9\\u5927\\u5c0f\\u4e0e\\u989c\\u8272\\u7684\\u6563\\u70b9\\u56fe\"},\"id\":\"1776\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"1812\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1813\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1814\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1816\",\"type\":\"CDSView\"}},\"id\":\"1815\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1797\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1798\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1805\",\"type\":\"BoxAnnotation\"}},\"id\":\"1799\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1800\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1801\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1802\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1871\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1872\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"1783\",\"type\":\"LinearScale\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1797\",\"type\":\"PanTool\"},{\"id\":\"1798\",\"type\":\"WheelZoomTool\"},{\"id\":\"1799\",\"type\":\"BoxZoomTool\"},{\"id\":\"1800\",\"type\":\"SaveTool\"},{\"id\":\"1801\",\"type\":\"ResetTool\"},{\"id\":\"1802\",\"type\":\"HelpTool\"}]},\"id\":\"1803\",\"type\":\"Toolbar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1805\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1785\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1869\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1777\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1788\",\"type\":\"BasicTicker\"}},\"id\":\"1787\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"1812\",\"type\":\"ColumnDataSource\"}},\"id\":\"1816\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1788\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1869\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1872\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1871\",\"type\":\"UnionRenderers\"}},\"id\":\"1812\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"1777\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1788\",\"type\":\"BasicTicker\"}},\"id\":\"1791\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1867\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"1777\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"c779994c-34bb-4a6e-94d2-641b31d1828e\",\"roots\":{\"1777\":\"492b2b75-5c9a-4dcd-ac51-a9b103888d56\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "1777"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# 设置目标点大小与颜色\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027设置目标点大小与颜色的散点图\u0027)\n",
        "\n",
        "r \u003d p.circle(x, y)\n",
        "r.glyph.size \u003d 10\n",
        "r.glyph.fill_alpha \u003d 0.2\n",
        "r.glyph.line_color \u003d \u0027firebrick\u0027\n",
        "r.glyph.line_dash \u003d [5, 1]\n",
        "r.glyph.line_width \u003d 2\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"7eb3e689-db5f-4eda-a1c5-13f5b661b5df\" data-root-id\u003d\"2076\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"ca93ec21-6252-4b46-9ca2-5191e216859d\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2086\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"2091\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2086\",\"type\":\"LinearAxis\"},{\"id\":\"2090\",\"type\":\"Grid\"},{\"id\":\"2091\",\"type\":\"LinearAxis\"},{\"id\":\"2095\",\"type\":\"Grid\"},{\"id\":\"2104\",\"type\":\"BoxAnnotation\"},{\"id\":\"2115\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2075\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2102\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2078\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2082\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2080\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2084\",\"type\":\"LinearScale\"}},\"id\":\"2076\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2188\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"2183\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2076\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2092\",\"type\":\"BasicTicker\"}},\"id\":\"2091\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"2076\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2092\",\"type\":\"BasicTicker\"}},\"id\":\"2095\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"2080\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2092\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"2076\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2087\",\"type\":\"BasicTicker\"}},\"id\":\"2090\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"2188\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2187\",\"type\":\"UnionRenderers\"}},\"id\":\"2111\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"2104\",\"type\":\"BoxAnnotation\"}},\"id\":\"2098\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2082\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2096\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2097\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2087\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_color\":{\"value\":\"firebrick\"},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2114\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2084\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2112\",\"type\":\"Circle\"},{\"attributes\":{\"formatter\":{\"id\":\"2185\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2076\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2087\",\"type\":\"BasicTicker\"}},\"id\":\"2086\",\"type\":\"LinearAxis\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2096\",\"type\":\"PanTool\"},{\"id\":\"2097\",\"type\":\"WheelZoomTool\"},{\"id\":\"2098\",\"type\":\"BoxZoomTool\"},{\"id\":\"2099\",\"type\":\"SaveTool\"},{\"id\":\"2100\",\"type\":\"ResetTool\"},{\"id\":\"2101\",\"type\":\"HelpTool\"}]},\"id\":\"2102\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.2},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2113\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2099\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2185\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u5e26\\u9009\\u62e9\\u7684\\u6563\\u70b9\\u56fe\"},\"id\":\"2075\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"2111\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2112\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2113\",\"type\":\"Circle\"},\"selection_glyph\":{\"id\":\"2114\",\"type\":\"Circle\"},\"view\":{\"id\":\"2116\",\"type\":\"CDSView\"}},\"id\":\"2115\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2101\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2100\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2183\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"2078\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"2111\",\"type\":\"ColumnDataSource\"}},\"id\":\"2116\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2187\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2104\",\"type\":\"BoxAnnotation\"}],\"root_ids\":[\"2076\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"ca93ec21-6252-4b46-9ca2-5191e216859d\",\"roots\":{\"2076\":\"7eb3e689-db5f-4eda-a1c5-13f5b661b5df\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "2076"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# 带选择的散点图\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027带选择的散点图\u0027)\n",
        "\n",
        "renderer \u003d p.circle(x, y, size\u003d10, \n",
        "                     selection_color\u003d\u0027firebrick\u0027, \n",
        "                     nonselection_fill_alpha\u003d0.2,\n",
        "                     nonselection_fill_color\u003d\u0027gray\u0027,\n",
        "                     nonselection_line_color\u003d\u0027firebrick\u0027,\n",
        "                     nonselection_line_alpha\u003d1.0\n",
        "                    )\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 57,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"0d7b41e1-f43a-4605-9f01-3b4e3c1a9a6c\" data-root-id\u003d\"13297\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"55669942-ce08-44a3-a66f-2e473c8eeeb9\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"13306\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"13311\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"13306\",\"type\":\"LinearAxis\"},{\"id\":\"13310\",\"type\":\"Grid\"},{\"id\":\"13311\",\"type\":\"LinearAxis\"},{\"id\":\"13315\",\"type\":\"Grid\"},{\"id\":\"13324\",\"type\":\"BoxAnnotation\"},{\"id\":\"13335\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"13731\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"13322\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"13298\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"13302\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"13300\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"13304\",\"type\":\"LinearScale\"}},\"id\":\"13297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"13331\",\"type\":\"ColumnDataSource\"}},\"id\":\"13336\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"13298\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"13307\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"13297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"13307\",\"type\":\"BasicTicker\"}},\"id\":\"13310\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"13736\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"13297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"13307\",\"type\":\"BasicTicker\"}},\"id\":\"13306\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"13734\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"13297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"13312\",\"type\":\"BasicTicker\"}},\"id\":\"13311\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"13312\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"13304\",\"type\":\"LinearScale\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"13297\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"13312\",\"type\":\"BasicTicker\"}},\"id\":\"13315\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"13734\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"13316\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"13736\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"a\"},\"y\":{\"field\":\"d\"}},\"id\":\"13334\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"13738\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"13317\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"13739\",\"type\":\"Selection\"},{\"attributes\":{\"overlay\":{\"id\":\"13324\",\"type\":\"BoxAnnotation\"}},\"id\":\"13318\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"13731\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"a\"},\"y\":{\"field\":\"d\"}},\"id\":\"13333\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"13319\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"13320\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"13321\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"a\":[1,2,12,10,15,23],\"b\":[3,4,74,14,26,25],\"c\":[7,6,25,9,9,46],\"d\":[9,8,38,23,18,18],\"index\":[0,1,2,3,4,5]},\"selected\":{\"id\":\"13739\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"13738\",\"type\":\"UnionRenderers\"}},\"id\":\"13331\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"13316\",\"type\":\"PanTool\"},{\"id\":\"13317\",\"type\":\"WheelZoomTool\"},{\"id\":\"13318\",\"type\":\"BoxZoomTool\"},{\"id\":\"13319\",\"type\":\"SaveTool\"},{\"id\":\"13320\",\"type\":\"ResetTool\"},{\"id\":\"13321\",\"type\":\"HelpTool\"}]},\"id\":\"13322\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"13331\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"13333\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"13334\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"13336\",\"type\":\"CDSView\"}},\"id\":\"13335\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"13324\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null},\"id\":\"13300\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"13302\",\"type\":\"LinearScale\"}],\"root_ids\":[\"13297\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"55669942-ce08-44a3-a66f-2e473c8eeeb9\",\"roots\":{\"13297\":\"0d7b41e1-f43a-4605-9f01-3b4e3c1a9a6c\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "13297"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# dataframe散点图\n",
        "import pandas as pd\n",
        "\n",
        "df \u003d pd.DataFrame([[1,3,7,9], [2, 4, 6, 8], [12,74, 25, 38], [10, 14, 9, 23], [15,26, 9, 18], [23, 25,46, 18]], columns \u003d [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027])\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400)\n",
        "p.circle(\u0027a\u0027, \u0027d\u0027, source\u003ddf)\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"7e6d5f49-ccc7-431a-98a2-b55cd184e615\" data-root-id\u003d\"2238\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"9db09139-1427-4ac6-914a-266a98afb832\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2248\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"2253\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2248\",\"type\":\"LinearAxis\"},{\"id\":\"2252\",\"type\":\"Grid\"},{\"id\":\"2253\",\"type\":\"LinearAxis\"},{\"id\":\"2257\",\"type\":\"Grid\"},{\"id\":\"2266\",\"type\":\"BoxAnnotation\"},{\"id\":\"2276\",\"type\":\"GlyphRenderer\"},{\"id\":\"2282\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2237\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2264\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2240\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2244\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2242\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2246\",\"type\":\"LinearScale\"}},\"id\":\"2238\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2258\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2259\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2360\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"2266\",\"type\":\"BoxAnnotation\"}},\"id\":\"2260\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"hover\\u6563\\u70b9\\u56fe\"},\"id\":\"2237\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2261\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2275\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2262\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"2365\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2364\",\"type\":\"UnionRenderers\"}},\"id\":\"2273\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2263\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null},\"id\":\"2240\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2258\",\"type\":\"PanTool\"},{\"id\":\"2259\",\"type\":\"WheelZoomTool\"},{\"id\":\"2260\",\"type\":\"BoxZoomTool\"},{\"id\":\"2261\",\"type\":\"SaveTool\"},{\"id\":\"2262\",\"type\":\"ResetTool\"},{\"id\":\"2263\",\"type\":\"HelpTool\"},{\"id\":\"2284\",\"type\":\"HoverTool\"}]},\"id\":\"2264\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null},\"id\":\"2242\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2244\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2266\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2246\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"2362\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2238\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2249\",\"type\":\"BasicTicker\"}},\"id\":\"2248\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"2273\",\"type\":\"ColumnDataSource\"}},\"id\":\"2277\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2249\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"mode\":\"hline\",\"renderers\":[{\"id\":\"2282\",\"type\":\"GlyphRenderer\"}],\"tooltips\":null},\"id\":\"2284\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"2362\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2365\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.05},\"line_color\":{\"value\":null},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2279\",\"type\":\"Circle\"},{\"attributes\":{\"plot\":{\"id\":\"2238\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2249\",\"type\":\"BasicTicker\"}},\"id\":\"2252\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2280\",\"type\":\"Circle\"},{\"attributes\":{\"formatter\":{\"id\":\"2360\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2238\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2254\",\"type\":\"BasicTicker\"}},\"id\":\"2253\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.3},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.3},\"line_color\":{\"value\":\"white\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2281\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2367\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2254\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"2278\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2279\",\"type\":\"Circle\"},\"hover_glyph\":{\"id\":\"2281\",\"type\":\"Circle\"},\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2280\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"2283\",\"type\":\"CDSView\"}},\"id\":\"2282\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"2238\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2254\",\"type\":\"BasicTicker\"}},\"id\":\"2257\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2364\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2278\",\"type\":\"ColumnDataSource\"}},\"id\":\"2283\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"2367\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2366\",\"type\":\"UnionRenderers\"}},\"id\":\"2278\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":\"gray\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2274\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2366\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"2273\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2274\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2275\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"2277\",\"type\":\"CDSView\"}},\"id\":\"2276\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"2238\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"9db09139-1427-4ac6-914a-266a98afb832\",\"roots\":{\"2238\":\"7e6d5f49-ccc7-431a-98a2-b55cd184e615\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "2238"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# hover散点图\n",
        "from bokeh.models.tools import HoverTool\n",
        "\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027hover散点图\u0027)\n",
        "p.line(x, y, line_width\u003d1, color\u003d\u0027gray\u0027)\n",
        "\n",
        "cr \u003d p.circle(x, y, size\u003d20, fill_color\u003d\u0027gray\u0027, hover_fill_color\u003d\u0027firebrick\u0027,\n",
        "            fill_alpha\u003d0.05, hover_alpha\u003d0.3, line_color\u003dNone, hover_line_color\u003d\u0027white\u0027)\n",
        "p.add_tools(HoverTool(tooltips\u003dNone, renderers\u003d[cr], mode\u003d\u0027hline\u0027))\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"ee66170f-985b-44bb-b225-c69609749357\" data-root-id\u003d\"2429\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"5c078ef2-759b-4fa8-81f4-c231a658c536\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2439\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"2444\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2439\",\"type\":\"LinearAxis\"},{\"id\":\"2443\",\"type\":\"Grid\"},{\"id\":\"2444\",\"type\":\"LinearAxis\"},{\"id\":\"2448\",\"type\":\"Grid\"},{\"id\":\"2457\",\"type\":\"BoxAnnotation\"},{\"id\":\"2467\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2428\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2455\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2431\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2435\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2433\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2437\",\"type\":\"LinearScale\"}},\"id\":\"2429\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2466\",\"type\":\"X\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"2558\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2557\",\"type\":\"UnionRenderers\"}},\"id\":\"2464\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2450\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2449\",\"type\":\"PanTool\"},{\"id\":\"2450\",\"type\":\"WheelZoomTool\"},{\"id\":\"2451\",\"type\":\"BoxZoomTool\"},{\"id\":\"2452\",\"type\":\"SaveTool\"},{\"id\":\"2453\",\"type\":\"ResetTool\"},{\"id\":\"2454\",\"type\":\"HelpTool\"}]},\"id\":\"2455\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2437\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"2464\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2465\",\"type\":\"X\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2466\",\"type\":\"X\"},\"selection_glyph\":null,\"view\":{\"id\":\"2468\",\"type\":\"CDSView\"}},\"id\":\"2467\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"2464\",\"type\":\"ColumnDataSource\"}},\"id\":\"2468\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2553\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"2429\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2445\",\"type\":\"BasicTicker\"}},\"id\":\"2448\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2449\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2557\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2457\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2445\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2454\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":null,\"text\":\"X\\u6807\\u8bc6\\u7684\\u6563\\u70b9\\u56fe\"},\"id\":\"2428\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2555\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2453\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"2555\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"2429\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2440\",\"type\":\"BasicTicker\"}},\"id\":\"2439\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2465\",\"type\":\"X\"},{\"attributes\":{},\"id\":\"2558\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2435\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2440\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"2431\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"2553\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":\"vertical\",\"plot\":{\"id\":\"2429\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2445\",\"type\":\"BasicTicker\"}},\"id\":\"2444\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"2429\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2440\",\"type\":\"BasicTicker\"}},\"id\":\"2443\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"2457\",\"type\":\"BoxAnnotation\"}},\"id\":\"2451\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2452\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null},\"id\":\"2433\",\"type\":\"DataRange1d\"}],\"root_ids\":[\"2429\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"5c078ef2-759b-4fa8-81f4-c231a658c536\",\"roots\":{\"2429\":\"ee66170f-985b-44bb-b225-c69609749357\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "2429"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 散点图\n",
        "# X标识的散点图\n",
        "from bokeh.models.tools import HoverTool\n",
        "\n",
        "x \u003d [1,2,3,4,5]\n",
        "y \u003d [2,5,8,2,7]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027X标识的散点图\u0027)\n",
        "\n",
        "p.x(x, y, size\u003d10, line_width\u003d2)\n",
        "        \n",
        "# 坐标轴值旋转\n",
        "p.xaxis.major_label_orientation \u003d np.pi / 4\n",
        "p.yaxis.major_label_orientation \u003d \u0027vertical\u0027\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"5466c9b2-9218-42ae-a7c2-8b9817b609f6\" data-root-id\u003d\"2608\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"3be3189f-d319-473f-8a37-a3d674a954c1\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2618\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"2623\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2618\",\"type\":\"LinearAxis\"},{\"id\":\"2622\",\"type\":\"Grid\"},{\"id\":\"2623\",\"type\":\"LinearAxis\"},{\"id\":\"2627\",\"type\":\"Grid\"},{\"id\":\"2636\",\"type\":\"BoxAnnotation\"},{\"id\":\"2646\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"2607\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"2634\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"2610\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"2614\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2612\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"2616\",\"type\":\"LinearScale\"}},\"id\":\"2608\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"2608\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2619\",\"type\":\"BasicTicker\"}},\"id\":\"2622\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2628\",\"type\":\"PanTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"2608\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2624\",\"type\":\"BasicTicker\"}},\"id\":\"2627\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2629\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2636\",\"type\":\"BoxAnnotation\"}},\"id\":\"2630\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2631\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null},\"id\":\"2612\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2632\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"2742\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2608\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2619\",\"type\":\"BasicTicker\"}},\"id\":\"2618\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2633\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2742\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2628\",\"type\":\"PanTool\"},{\"id\":\"2629\",\"type\":\"WheelZoomTool\"},{\"id\":\"2630\",\"type\":\"BoxZoomTool\"},{\"id\":\"2631\",\"type\":\"SaveTool\"},{\"id\":\"2632\",\"type\":\"ResetTool\"},{\"id\":\"2633\",\"type\":\"HelpTool\"}]},\"id\":\"2634\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[6,7,2,4,5]},\"selected\":{\"id\":\"2745\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2744\",\"type\":\"UnionRenderers\"}},\"id\":\"2643\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2643\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2644\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2645\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"2647\",\"type\":\"CDSView\"}},\"id\":\"2646\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2645\",\"type\":\"Line\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2636\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"2643\",\"type\":\"ColumnDataSource\"}},\"id\":\"2647\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2745\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"2740\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"2608\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2624\",\"type\":\"BasicTicker\"}},\"id\":\"2623\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2744\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2614\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2644\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null},\"id\":\"2610\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2740\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2619\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6298\\u7ebf\\u56fe\"},\"id\":\"2607\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2624\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2616\",\"type\":\"LinearScale\"}],\"root_ids\":[\"2608\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"3be3189f-d319-473f-8a37-a3d674a954c1\",\"roots\":{\"2608\":\"5466c9b2-9218-42ae-a7c2-8b9817b609f6\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "2608"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 折线图\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027折线图\u0027)\n",
        "    \n",
        "p.line([1, 2, 3, 4, 5,], [6, 7, 2, 4, 5], line_width\u003d2)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 48,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"e49b05a1-8315-41cd-9fa9-23b1e25ed92c\" data-root-id\u003d\"11013\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"15f1c67d-443c-45b0-8019-bc9aba0bc6cc\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"11023\",\"type\":\"DatetimeAxis\"}],\"left\":[{\"id\":\"11028\",\"type\":\"LinearAxis\"}],\"plot_height\":350,\"plot_width\":800,\"renderers\":[{\"id\":\"11023\",\"type\":\"DatetimeAxis\"},{\"id\":\"11027\",\"type\":\"Grid\"},{\"id\":\"11028\",\"type\":\"LinearAxis\"},{\"id\":\"11032\",\"type\":\"Grid\"},{\"id\":\"11041\",\"type\":\"BoxAnnotation\"},{\"id\":\"11051\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"11012\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"11039\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"11015\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"11019\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"11017\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"11021\",\"type\":\"LinearScale\"}},\"id\":\"11013\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"days\":[1,15]},\"id\":\"11412\",\"type\":\"DaysTicker\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1489363200000.0,1489449600000.0,1489536000000.0,1489622400000.0,1489708800000.0,1489968000000.0,1490054400000.0,1490140800000.0,1490227200000.0,1490313600000.0,1490572800000.0,1490659200000.0,1490745600000.0,1490832000000.0,1490918400000.0,1491350400000.0,1491436800000.0,1491523200000.0,1491782400000.0,1491868800000.0,1491955200000.0,1492041600000.0,1492128000000.0,1492387200000.0,1492473600000.0,1492560000000.0,1492646400000.0,1492732800000.0,1492992000000.0,1493078400000.0,1493164800000.0,1493251200000.0,1493337600000.0,1493683200000.0,1493769600000.0,1493856000000.0,1493942400000.0,1494201600000.0,1494288000000.0,1494374400000.0,1494460800000.0,1494547200000.0,1494806400000.0,1494892800000.0,1494979200000.0,1495065600000.0,1495152000000.0,1495411200000.0,1495497600000.0,1495584000000.0,1495670400000.0,1495756800000.0,1496102400000.0,1496188800000.0,1496275200000.0,1496361600000.0,1496620800000.0,1496707200000.0,1496793600000.0,1496880000000.0,1496966400000.0,1497225600000.0,1497312000000.0,1497398400000.0,1497484800000.0,1497571200000.0,1497830400000.0,1497916800000.0,1498003200000.0,1498089600000.0,1498176000000.0,1498435200000.0,1498521600000.0,1498608000000.0,1498694400000.0,1498780800000.0,1499040000000.0,1499126400000.0,1499212800000.0,1499299200000.0,1499385600000.0,1499644800000.0,1499731200000.0,1499817600000.0,1499904000000.0,1499990400000.0,1500249600000.0,1500336000000.0,1500422400000.0,1500508800000.0,1500595200000.0,1500854400000.0,1500940800000.0,1501027200000.0,1501113600000.0,1501200000000.0,1501459200000.0,1501545600000.0,1501632000000.0,1501718400000.0,1501804800000.0,1502064000000.0,1502150400000.0,1502236800000.0,1502323200000.0,1502409600000.0,1502668800000.0,1502755200000.0,1502841600000.0,1502928000000.0,1503014400000.0,1503273600000.0,1503360000000.0,1503446400000.0,1503532800000.0,1503619200000.0,1503878400000.0,1503964800000.0,1504051200000.0,1504137600000.0,1504224000000.0,1504483200000.0,1504569600000.0,1504656000000.0,1504742400000.0,1504828800000.0,1505088000000.0,1505174400000.0,1505260800000.0,1505347200000.0,1505433600000.0,1505692800000.0,1505779200000.0,1505865600000.0,1505952000000.0,1506038400000.0,1506297600000.0,1506384000000.0,1506470400000.0,1506556800000.0,1506643200000.0,1507507200000.0,1507593600000.0,1507680000000.0,1507766400000.0,1507852800000.0,1508112000000.0,1508198400000.0,1508284800000.0,1508371200000.0,1508457600000.0,1508716800000.0,1508803200000.0,1508889600000.0,1508976000000.0,1509062400000.0,1509321600000.0,1509408000000.0,1509494400000.0,1509580800000.0,1509667200000.0,1509926400000.0,1510012800000.0,1510099200000.0,1510185600000.0,1510272000000.0,1510531200000.0,1510617600000.0,1510704000000.0,1510790400000.0,1510876800000.0,1511136000000.0,1511222400000.0,1511308800000.0,1511395200000.0,1511481600000.0,1511740800000.0,1511827200000.0,1511913600000.0,1512000000000.0,1512086400000.0,1512345600000.0,1512432000000.0,1512518400000.0,1512604800000.0,1512691200000.0,1512950400000.0,1513036800000.0,1513123200000.0,1513209600000.0,1513296000000.0,1513555200000.0,1513641600000.0,1513728000000.0,1513814400000.0,1513900800000.0,1514160000000.0,1514246400000.0,1514332800000.0,1514419200000.0,1514505600000.0,1514851200000.0,1514937600000.0,1515024000000.0,1515110400000.0,1515369600000.0,1515456000000.0,1515542400000.0,1515628800000.0,1515715200000.0,1515974400000.0,1516060800000.0,1516147200000.0,1516233600000.0,1516320000000.0,1516579200000.0,1516665600000.0,1516752000000.0,1516838400000.0,1516924800000.0,1517184000000.0,1517270400000.0,1517356800000.0,1517443200000.0,1517529600000.0,1517788800000.0,1517875200000.0,1517961600000.0,1518048000000.0,1518134400000.0,1518393600000.0,1518480000000.0,1518566400000.0,1519257600000.0,1519344000000.0,1519603200000.0,1519689600000.0,1519776000000.0,1519862400000.0,1519948800000.0,1520208000000.0,1520294400000.0,1520380800000.0,1520467200000.0,1520553600000.0,1520812800000.0,1520899200000.0,1520985600000.0,1521072000000.0,1521158400000.0,1521417600000.0,1521504000000.0,1521590400000.0,1521676800000.0,1521763200000.0,1522022400000.0,1522108800000.0,1522195200000.0,1522281600000.0,1522368000000.0,1522627200000.0,1522713600000.0,1522800000000.0,1523232000000.0,1523318400000.0,1523404800000.0,1523491200000.0,1523577600000.0,1523836800000.0,1523923200000.0,1524009600000.0,1524096000000.0,1524182400000.0,1524441600000.0,1524528000000.0,1524614400000.0,1524700800000.0,1524787200000.0,1525219200000.0,1525305600000.0,1525392000000.0,1525651200000.0,1525737600000.0,1525824000000.0,1525910400000.0,1525996800000.0,1526256000000.0,1526342400000.0,1526428800000.0,1526515200000.0,1526601600000.0,1526860800000.0,1526947200000.0,1527033600000.0,1527120000000.0,1527206400000.0,1527465600000.0,1527552000000.0,1527638400000.0,1527724800000.0,1527811200000.0,1528070400000.0,1528156800000.0,1528243200000.0,1528329600000.0,1528416000000.0,1528675200000.0,1528761600000.0,1528848000000.0,1528934400000.0,1529020800000.0,1529366400000.0,1529452800000.0,1529539200000.0,1529625600000.0,1529884800000.0,1529971200000.0,1530057600000.0,1530144000000.0,1530230400000.0,1530489600000.0,1530576000000.0,1530662400000.0,1530748800000.0,1530835200000.0,1531094400000.0,1531180800000.0,1531267200000.0,1531353600000.0,1531440000000.0,1531699200000.0,1531785600000.0,1531872000000.0,1531958400000.0,1532044800000.0,1532304000000.0,1532390400000.0,1532476800000.0,1532563200000.0,1532649600000.0,1532908800000.0,1532995200000.0,1533081600000.0,1533168000000.0,1533254400000.0,1533513600000.0,1533600000000.0,1533686400000.0,1533772800000.0,1533859200000.0,1534118400000.0,1534204800000.0,1534291200000.0,1534377600000.0,1534464000000.0,1534723200000.0,1534809600000.0,1534896000000.0,1534982400000.0,1535068800000.0,1535328000000.0,1535414400000.0,1535500800000.0,1535587200000.0,1535673600000.0,1535932800000.0,1536019200000.0,1536105600000.0,1536192000000.0,1536278400000.0,1536537600000.0,1536624000000.0,1536710400000.0,1536796800000.0,1536883200000.0,1537142400000.0,1537228800000.0,1537315200000.0,1537401600000.0,1537488000000.0,1537833600000.0,1537920000000.0,1538006400000.0,1538092800000.0,1538956800000.0,1539043200000.0,1539129600000.0,1539216000000.0,1539302400000.0,1539561600000.0,1539648000000.0,1539734400000.0,1539820800000.0,1539907200000.0,1540166400000.0,1540252800000.0,1540339200000.0,1540425600000.0,1540512000000.0,1540771200000.0,1540857600000.0,1540944000000.0,1541030400000.0,1541116800000.0,1541376000000.0,1541462400000.0,1541548800000.0,1541635200000.0,1541721600000.0,1541980800000.0,1542067200000.0,1542153600000.0,1542240000000.0,1542326400000.0,1542585600000.0,1542672000000.0,1542758400000.0,1542844800000.0,1542931200000.0,1543190400000.0,1543276800000.0,1543363200000.0,1543449600000.0,1543536000000.0,1543795200000.0,1543881600000.0,1543968000000.0,1544054400000.0,1544140800000.0,1544400000000.0,1544486400000.0,1544572800000.0,1544659200000.0,1544745600000.0,1545004800000.0,1545091200000.0,1545177600000.0,1545264000000.0,1545350400000.0,1545609600000.0,1545696000000.0,1545782400000.0,1545868800000.0,1545955200000.0,1546387200000.0,1546473600000.0,1546560000000.0,1546819200000.0,1546905600000.0,1546992000000.0,1547078400000.0,1547164800000.0,1547424000000.0,1547510400000.0,1547596800000.0,1547683200000.0,1547769600000.0,1548028800000.0,1548115200000.0,1548201600000.0,1548288000000.0,1548374400000.0,1548633600000.0,1548720000000.0,1548806400000.0,1548892800000.0,1548979200000.0,1549843200000.0,1549929600000.0,1550016000000.0,1550102400000.0,1550188800000.0,1550448000000.0,1550534400000.0,1550620800000.0,1550707200000.0,1550793600000.0,1551052800000.0,1551139200000.0,1551225600000.0,1551312000000.0,1551398400000.0,1551657600000.0,1551744000000.0,1551830400000.0,1551916800000.0,1552003200000.0,1552262400000.0,1552348800000.0,1552435200000.0,1552521600000.0,1552608000000.0,1552867200000.0,1552953600000.0,1553040000000.0,1553126400000.0,1553212800000.0,1553472000000.0,1553558400000.0,1553644800000.0,1553731200000.0,1553817600000.0,1554076800000.0,1554163200000.0,1554249600000.0,1554336000000.0,1554681600000.0,1554768000000.0,1554854400000.0,1554940800000.0,1555027200000.0,1555286400000.0,1555372800000.0,1555459200000.0,1555545600000.0,1555632000000.0,1555891200000.0,1555977600000.0,1556064000000.0,1556150400000.0,1556236800000.0,1556496000000.0,1556582400000.0,1557100800000.0,1557187200000.0,1557273600000.0,1557360000000.0,1557446400000.0,1557705600000.0,1557792000000.0,1557878400000.0,1557964800000.0,1558051200000.0,1558310400000.0,1558396800000.0,1558483200000.0,1558569600000.0,1558656000000.0,1558915200000.0,1559001600000.0,1559088000000.0,1559174400000.0,1559260800000.0,1559520000000.0,1559606400000.0,1559692800000.0,1559779200000.0,1560124800000.0,1560211200000.0,1560297600000.0,1560384000000.0,1560470400000.0,1560729600000.0,1560816000000.0,1560902400000.0,1560988800000.0,1561075200000.0,1561334400000.0,1561420800000.0,1561507200000.0,1561593600000.0,1561680000000.0,1561939200000.0,1562025600000.0,1562112000000.0,1562198400000.0,1562284800000.0,1562544000000.0,1562630400000.0,1562716800000.0,1562803200000.0,1562889600000.0,1563148800000.0,1563235200000.0,1563321600000.0,1563408000000.0,1563494400000.0,1563753600000.0,1563840000000.0,1563926400000.0,1564012800000.0,1564099200000.0,1564358400000.0,1564444800000.0,1564531200000.0,1564617600000.0,1564704000000.0,1564963200000.0,1565049600000.0,1565136000000.0,1565222400000.0,1565308800000.0,1565568000000.0,1565654400000.0,1565740800000.0,1565827200000.0,1565913600000.0,1566172800000.0,1566259200000.0,1566345600000.0,1566432000000.0,1566518400000.0,1566777600000.0,1566864000000.0,1566950400000.0,1567036800000.0,1567123200000.0,1567382400000.0,1567468800000.0,1567555200000.0,1567641600000.0,1567728000000.0,1567987200000.0],\"y\":[9.44,9.44,9.48,9.52,9.31,9.25,9.24,9.16,9.2,9.19,9.14,9.12,9.11,9.08,9.17,9.21,9.2,9.2,9.18,9.15,9.12,9.12,9.08,9.1,9.05,8.91,8.92,8.97,8.93,9.0,8.99,8.97,8.99,8.94,8.91,8.74,8.63,8.57,8.64,8.67,8.7,8.9,8.86,8.84,8.77,8.73,8.69,8.68,8.79,8.81,9.1,9.1,9.11,9.2,9.19,9.17,9.03,9.04,9.13,9.13,9.15,9.11,9.12,9.08,9.04,9.02,9.13,9.12,9.15,9.25,9.25,9.3,9.36,9.43,9.43,9.39,9.4,9.34,9.37,9.4,9.47,9.59,10.25,10.34,10.9,10.9,10.81,11.05,11.09,10.97,10.89,10.95,11.0,10.74,10.59,10.74,10.67,11.04,11.15,11.01,11.17,11.0,11.05,10.73,10.62,10.02,10.22,10.31,10.34,10.42,10.44,10.46,10.65,10.9,10.93,11.11,11.35,11.67,11.43,11.28,11.21,11.72,11.64,11.7,11.44,11.49,11.38,11.54,11.43,11.32,11.29,11.25,11.13,11.29,11.46,11.44,11.29,11.05,10.93,10.88,11.11,11.3,11.47,11.53,11.55,11.36,11.59,11.51,11.69,11.63,11.48,11.19,11.39,11.27,11.18,11.56,11.56,11.54,11.4,11.54,11.39,11.28,11.92,12.13,12.33,12.3,12.9,12.95,12.9,13.1,13.18,14.25,14.45,15.1,14.35,14.56,13.93,13.7,13.82,13.38,13.0,13.3,13.3,13.08,12.83,13.09,13.5,13.02,13.13,13.0,12.72,12.75,13.28,13.26,13.54,13.52,13.25,13.66,13.29,13.21,13.3,13.7,13.33,13.25,13.3,12.96,13.08,13.47,13.4,13.55,14.2,14.2,14.23,14.72,14.8,14.44,14.65,14.64,14.2,14.05,13.74,13.65,14.05,14.03,14.05,14.55,14.0,12.92,12.54,11.69,11.72,11.94,12.0,12.46,12.61,12.63,12.28,12.05,12.04,11.95,11.86,12.1,12.05,12.11,12.09,12.03,12.02,11.92,11.71,11.64,11.83,11.82,11.9,11.66,11.34,10.93,10.94,10.89,11.05,10.9,10.71,10.56,10.87,11.02,11.42,11.83,11.52,11.57,11.1,11.21,11.5,11.47,11.35,11.57,11.86,11.68,11.42,10.85,10.88,10.75,10.68,10.81,11.01,10.97,11.01,11.01,11.18,11.12,10.9,10.82,10.96,10.95,10.86,10.65,10.61,10.59,10.59,10.38,10.08,10.18,10.19,10.27,10.26,10.14,10.37,10.12,10.04,10.06,9.95,10.07,10.17,9.87,9.91,9.86,9.85,9.46,9.36,9.09,8.92,9.09,8.61,8.67,8.61,8.6,8.66,9.03,8.98,8.78,8.88,8.88,8.73,8.72,8.7,8.73,9.11,9.42,9.4,9.38,9.25,9.25,9.39,9.42,9.15,8.94,8.91,8.94,9.17,9.05,9.29,9.23,9.05,9.0,8.79,8.78,8.81,9.0,9.23,9.29,9.36,10.03,10.43,10.29,10.27,10.12,10.13,10.19,10.43,10.05,9.97,10.01,9.88,9.91,9.88,9.96,9.84,9.69,10.08,10.24,10.23,10.67,10.55,10.71,10.74,11.05,10.45,10.56,10.45,9.86,10.3,10.11,10.37,10.33,10.09,10.76,11.15,10.84,11.04,11.29,11.18,10.75,10.9,10.91,10.83,11.09,10.92,10.84,10.81,10.89,10.55,10.56,10.54,10.44,10.62,10.57,10.85,10.57,10.61,10.55,10.32,10.34,10.18,10.28,10.2,10.36,10.59,10.59,10.45,10.25,10.28,10.17,10.23,10.24,10.39,10.17,10.29,10.12,9.94,9.71,9.45,9.42,9.34,9.3,9.28,9.38,9.19,9.28,9.75,9.74,9.66,9.94,10.1,10.2,10.11,10.24,10.48,10.25,10.43,10.34,10.28,10.35,10.52,11.0,10.94,11.0,10.95,11.1,11.2,11.21,11.19,11.38,11.25,10.95,11.36,11.27,11.41,11.36,11.54,12.55,12.2,12.4,12.36,12.76,12.99,13.06,13.08,12.74,12.3,12.32,12.36,12.37,12.43,12.5,12.91,12.79,12.75,12.69,12.59,12.11,12.1,12.38,12.22,12.82,13.18,13.36,13.44,13.86,13.96,13.81,13.73,13.54,13.42,13.69,14.58,14.35,14.34,14.73,14.15,14.07,14.44,14.13,13.79,14.1,13.85,12.87,12.95,12.6,12.16,12.68,12.3,12.49,12.92,12.85,12.44,12.38,12.56,12.4,12.29,12.35,12.37,12.49,12.4,12.22,12.18,11.9,11.85,11.97,11.92,12.34,12.65,12.57,12.59,12.49,12.67,12.8,13.07,13.8,13.64,13.69,13.43,13.37,13.71,13.78,13.93,14.18,14.01,13.99,13.92,13.59,13.59,13.56,13.54,14.12,14.0,13.75,13.69,13.67,13.99,13.85,13.76,13.88,14.2,14.23,14.29,14.37,14.13,14.1,13.74,13.35,13.37,13.54,14.38,14.52,15.12,14.89,14.97,14.94,14.9,14.92,14.99,14.45,14.31,14.65,14.25,14.31,14.27,14.13,14.16,14.45,14.3,14.44,14.58,14.81,14.67]},\"selected\":{\"id\":\"11419\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"11418\",\"type\":\"UnionRenderers\"}},\"id\":\"11048\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"11048\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"11049\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"11050\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"11052\",\"type\":\"CDSView\"}},\"id\":\"11051\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"11017\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"11049\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"11036\",\"type\":\"SaveTool\"},{\"attributes\":{\"months\":[0,1,2,3,4,5,6,7,8,9,10,11]},\"id\":\"11413\",\"type\":\"MonthsTicker\"},{\"attributes\":{},\"id\":\"11417\",\"type\":\"YearsTicker\"},{\"attributes\":{},\"id\":\"11037\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"11050\",\"type\":\"Line\"},{\"attributes\":{\"axis_label\":\"\\u65e5\\u671f\",\"formatter\":{\"id\":\"11404\",\"type\":\"DatetimeTickFormatter\"},\"plot\":{\"id\":\"11013\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11024\",\"type\":\"DatetimeTicker\"}},\"id\":\"11023\",\"type\":\"DatetimeAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"11041\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis_label\":\"\\u6536\\u76d8\\u4ef7\\uff08\\u5143\\uff09\",\"formatter\":{\"id\":\"11402\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"11013\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11029\",\"type\":\"BasicTicker\"}},\"id\":\"11028\",\"type\":\"LinearAxis\"},{\"attributes\":{\"months\":[0,4,8]},\"id\":\"11415\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"days\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},\"id\":\"11409\",\"type\":\"DaysTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"11013\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11029\",\"type\":\"BasicTicker\"}},\"id\":\"11032\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"11033\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"11021\",\"type\":\"LinearScale\"},{\"attributes\":{\"num_minor_ticks\":5,\"tickers\":[{\"id\":\"11406\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11407\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11408\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11409\",\"type\":\"DaysTicker\"},{\"id\":\"11410\",\"type\":\"DaysTicker\"},{\"id\":\"11411\",\"type\":\"DaysTicker\"},{\"id\":\"11412\",\"type\":\"DaysTicker\"},{\"id\":\"11413\",\"type\":\"MonthsTicker\"},{\"id\":\"11414\",\"type\":\"MonthsTicker\"},{\"id\":\"11415\",\"type\":\"MonthsTicker\"},{\"id\":\"11416\",\"type\":\"MonthsTicker\"},{\"id\":\"11417\",\"type\":\"YearsTicker\"}]},\"id\":\"11024\",\"type\":\"DatetimeTicker\"},{\"attributes\":{\"plot\":{\"id\":\"11013\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11024\",\"type\":\"DatetimeTicker\"}},\"id\":\"11027\",\"type\":\"Grid\"},{\"attributes\":{\"months\":[0,6]},\"id\":\"11416\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"overlay\":{\"id\":\"11041\",\"type\":\"BoxAnnotation\"}},\"id\":\"11035\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"11029\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"11034\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"base\":60,\"mantissas\":[1,2,5,10,15,20,30],\"max_interval\":1800000.0,\"min_interval\":1000.0,\"num_minor_ticks\":0},\"id\":\"11407\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"months\":[0,2,4,6,8,10]},\"id\":\"11414\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6298\\u7ebf\\u56fe-000001\\u6536\\u76d8\\u4ef7\\u8d70\\u52bf\\u56fe\"},\"id\":\"11012\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null},\"id\":\"11015\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"11404\",\"type\":\"DatetimeTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"11033\",\"type\":\"PanTool\"},{\"id\":\"11034\",\"type\":\"WheelZoomTool\"},{\"id\":\"11035\",\"type\":\"BoxZoomTool\"},{\"id\":\"11036\",\"type\":\"SaveTool\"},{\"id\":\"11037\",\"type\":\"ResetTool\"},{\"id\":\"11038\",\"type\":\"HelpTool\"}]},\"id\":\"11039\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"11048\",\"type\":\"ColumnDataSource\"}},\"id\":\"11052\",\"type\":\"CDSView\"},{\"attributes\":{\"mantissas\":[1,2,5],\"max_interval\":500.0,\"num_minor_ticks\":0},\"id\":\"11406\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"base\":24,\"mantissas\":[1,2,4,6,8,12],\"max_interval\":43200000.0,\"min_interval\":3600000.0,\"num_minor_ticks\":0},\"id\":\"11408\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{},\"id\":\"11419\",\"type\":\"Selection\"},{\"attributes\":{\"days\":[1,4,7,10,13,16,19,22,25,28]},\"id\":\"11410\",\"type\":\"DaysTicker\"},{\"attributes\":{},\"id\":\"11418\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"11402\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"11038\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"11019\",\"type\":\"LinearScale\"},{\"attributes\":{\"days\":[1,8,15,22]},\"id\":\"11411\",\"type\":\"DaysTicker\"}],\"root_ids\":[\"11013\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"15f1c67d-443c-45b0-8019-bc9aba0bc6cc\",\"roots\":{\"11013\":\"e49b05a1-8315-41cd-9fa9-23b1e25ed92c\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "11013"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 折线图\n",
        "import tushare as ts\n",
        "import datetime\n",
        "\n",
        "data \u003d ts.get_hist_data(\u0027000001\u0027)\n",
        "data \u003d data.sort_index()\n",
        "\n",
        "date \u003d data.index.tolist()\n",
        "date \u003d [datetime.datetime.strptime(day, \u0027%Y-%m-%d\u0027) for day in date]\n",
        "\n",
        "p \u003d figure(title\u003d\u0027折线图-000001收盘价走势图\u0027, plot_height\u003d350, plot_width\u003d800, x_axis_type\u003d\"datetime\")\n",
        "p.xaxis.axis_label\u003d\u0027日期\u0027\n",
        "p.yaxis.axis_label\u003d\u0027收盘价（元）\u0027\n",
        "\n",
        "p.line(date, data.close.tolist())\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 47,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"7ddc0b86-5245-43a5-9aa5-a790f897f0b0\" data-root-id\u003d\"10505\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"0db3588c-4cf2-4401-9c77-380bc8678b1a\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"10515\",\"type\":\"DatetimeAxis\"}],\"left\":[{\"id\":\"10520\",\"type\":\"LinearAxis\"}],\"plot_height\":350,\"plot_width\":800,\"renderers\":[{\"id\":\"10515\",\"type\":\"DatetimeAxis\"},{\"id\":\"10519\",\"type\":\"Grid\"},{\"id\":\"10520\",\"type\":\"LinearAxis\"},{\"id\":\"10524\",\"type\":\"Grid\"},{\"id\":\"10533\",\"type\":\"BoxAnnotation\"},{\"id\":\"10543\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"10504\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"10531\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"10507\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"10511\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"10509\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"10513\",\"type\":\"LinearScale\"}},\"id\":\"10505\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"10511\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"10530\",\"type\":\"HelpTool\"},{\"attributes\":{\"overlay\":{\"id\":\"10533\",\"type\":\"BoxAnnotation\"}},\"id\":\"10527\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"10528\",\"type\":\"SaveTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"10525\",\"type\":\"PanTool\"},{\"id\":\"10526\",\"type\":\"WheelZoomTool\"},{\"id\":\"10527\",\"type\":\"BoxZoomTool\"},{\"id\":\"10528\",\"type\":\"SaveTool\"},{\"id\":\"10529\",\"type\":\"ResetTool\"},{\"id\":\"10530\",\"type\":\"HelpTool\"}]},\"id\":\"10531\",\"type\":\"Toolbar\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6298\\u7ebf\\u56fe-000001\\u6536\\u76d8\\u4ef7\\u8d70\\u52bf\\u56fe\"},\"id\":\"10504\",\"type\":\"Title\"},{\"attributes\":{\"mantissas\":[1,2,5],\"max_interval\":500.0,\"num_minor_ticks\":0},\"id\":\"10878\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{},\"id\":\"10890\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null},\"id\":\"10509\",\"type\":\"DataRange1d\"},{\"attributes\":{\"months\":[0,6]},\"id\":\"10888\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"10533\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AACAbk+sdUIAAEDUoax1QgAAADr0rHVCAADAn0atdUIAAIAFma11QgAAwDaQrnVCAACAnOKudUIAAEACNa91QgAAAGiHr3VCAADAzdmvdUIAAAD/0LB1QgAAwGQjsXVCAACAynWxdUIAAEAwyLF1QgAAAJYasnVCAADAkrazdUIAAID4CLR1QgAAQF5btHVCAACAj1K1dUIAAED1pLV1QgAAAFv3tXVCAADAwEm2dUIAAIAmnLZ1QgAAwFeTt3VCAACAveW3dUIAAEAjOLh1QgAAAImKuHVCAADA7ty4dUIAAAAg1Ll1QgAAwIUmunVCAACA63i6dUIAAEBRy7p1QgAAALcdu3VCAAAATme8dUIAAMCzubx1QgAAgBkMvXVCAABAf169dUIAAICwVb51QgAAQBaovnVCAAAAfPq+dUIAAMDhTL91QgAAgEefv3VCAADAeJbAdUIAAIDe6MB1QgAAQEQ7wXVCAAAAqo3BdUIAAMAP4MF1QgAAAEHXwnVCAADApinDdUIAAIAMfMN1QgAAQHLOw3VCAAAA2CDEdUIAAABvasV1QgAA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C4pQHsUrkfh+ihA16NwPQpXKUCamZmZmZkpQKRwPQrXIypAmpmZmZmZK0BI4XoUrkcrQOF6FK5HYStAXI/C9SjcKkA9CtejcL0qQOxRuB6FaytAj8L1KFyPK0Bcj8L1KNwrQFyPwvUoXCxAhetRuB4FLEB7FK5H4forQNejcD0K1ytArkfhehQuK0CuR+F6FC4rQB+F61G4HitAFK5H4XoUK0A9CtejcD0sQAAAAAAAACxAAAAAAACAK0DhehSuR2ErQNejcD0KVytAexSuR+H6K0AzMzMzM7MrQIXrUbgehStAw/UoXI/CK0BmZmZmZmYsQPYoXI/CdSxAFK5H4XqULEA9CtejcL0sQMP1KFyPQixAMzMzMzMzLEB7FK5H4XorQDMzMzMzsypAPQrXo3C9KkAUrkfhehQrQMP1KFyPwixACtejcD0KLUA9CtejcD0uQEjhehSuxy1AcT0K16PwLUDhehSuR+EtQM3MzMzMzC1A16NwPQrXLUB7FK5H4fotQGZmZmZm5ixAH4XrUbieLEDNzMzMzEwtQAAAAAAAgCxAH4XrUbieLEAK16NwPYosQMP1KFyPQixAUrgehetRLEBmZmZmZuYsQJqZmZmZmSxA4XoUrkfhLEApXI/C9SgtQB+F61G4ni1A16NwPQpXLUA\u003d\",\"dtype\":\"float64\",\"shape\":[613]}},\"selected\":{\"id\":\"10891\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"10890\",\"type\":\"UnionRenderers\"}},\"id\":\"10540\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"base\":24,\"mantissas\":[1,2,4,6,8,12],\"max_interval\":43200000.0,\"min_interval\":3600000.0,\"num_minor_ticks\":0},\"id\":\"10880\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"10507\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"10889\",\"type\":\"YearsTicker\"},{\"attributes\":{},\"id\":\"10891\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"10529\",\"type\":\"ResetTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"10505\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"10521\",\"type\":\"BasicTicker\"}},\"id\":\"10524\",\"type\":\"Grid\"},{\"attributes\":{\"months\":[0,4,8]},\"id\":\"10887\",\"type\":\"MonthsTicker\"},{\"attributes\":{},\"id\":\"10874\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"10876\",\"type\":\"DatetimeTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"10540\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"10541\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"10542\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"10544\",\"type\":\"CDSView\"}},\"id\":\"10543\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"days\":[1,15]},\"id\":\"10884\",\"type\":\"DaysTicker\"},{\"attributes\":{\"axis_label\":\"\\u65e5\\u671f\",\"formatter\":{\"id\":\"10876\",\"type\":\"DatetimeTickFormatter\"},\"plot\":{\"id\":\"10505\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"10516\",\"type\":\"DatetimeTicker\"}},\"id\":\"10515\",\"type\":\"DatetimeAxis\"},{\"attributes\":{\"days\":[1,4,7,10,13,16,19,22,25,28]},\"id\":\"10882\",\"type\":\"DaysTicker\"},{\"attributes\":{\"days\":[1,8,15,22]},\"id\":\"10883\",\"type\":\"DaysTicker\"},{\"attributes\":{},\"id\":\"10525\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"10526\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"days\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},\"id\":\"10881\",\"type\":\"DaysTicker\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"10542\",\"type\":\"Line\"},{\"attributes\":{\"months\":[0,1,2,3,4,5,6,7,8,9,10,11]},\"id\":\"10885\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"axis_label\":\"\\u6536\\u76d8\\u4ef7\\uff08\\u5143\\uff09\",\"formatter\":{\"id\":\"10874\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"10505\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"10521\",\"type\":\"BasicTicker\"}},\"id\":\"10520\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"10540\",\"type\":\"ColumnDataSource\"}},\"id\":\"10544\",\"type\":\"CDSView\"},{\"attributes\":{\"months\":[0,2,4,6,8,10]},\"id\":\"10886\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"num_minor_ticks\":5,\"tickers\":[{\"id\":\"10878\",\"type\":\"AdaptiveTicker\"},{\"id\":\"10879\",\"type\":\"AdaptiveTicker\"},{\"id\":\"10880\",\"type\":\"AdaptiveTicker\"},{\"id\":\"10881\",\"type\":\"DaysTicker\"},{\"id\":\"10882\",\"type\":\"DaysTicker\"},{\"id\":\"10883\",\"type\":\"DaysTicker\"},{\"id\":\"10884\",\"type\":\"DaysTicker\"},{\"id\":\"10885\",\"type\":\"MonthsTicker\"},{\"id\":\"10886\",\"type\":\"MonthsTicker\"},{\"id\":\"10887\",\"type\":\"MonthsTicker\"},{\"id\":\"10888\",\"type\":\"MonthsTicker\"},{\"id\":\"10889\",\"type\":\"YearsTicker\"}]},\"id\":\"10516\",\"type\":\"DatetimeTicker\"},{\"attributes\":{\"plot\":{\"id\":\"10505\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"10516\",\"type\":\"DatetimeTicker\"}},\"id\":\"10519\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":0.5,\"line_color\":\"navy\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"10541\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"10521\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"10513\",\"type\":\"LinearScale\"},{\"attributes\":{\"base\":60,\"mantissas\":[1,2,5,10,15,20,30],\"max_interval\":1800000.0,\"min_interval\":1000.0,\"num_minor_ticks\":0},\"id\":\"10879\",\"type\":\"AdaptiveTicker\"}],\"root_ids\":[\"10505\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"0db3588c-4cf2-4401-9c77-380bc8678b1a\",\"roots\":{\"10505\":\"7ddc0b86-5245-43a5-9aa5-a790f897f0b0\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "10505"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 折线图\n",
        "import tushare as ts\n",
        "import datetime\n",
        "\n",
        "data \u003d ts.get_hist_data(\u0027000001\u0027)\n",
        "data \u003d data.sort_index()\n",
        "\n",
        "data[\u0027date\u0027] \u003d data.index\n",
        "data[\u0027date\u0027] \u003d data[\u0027date\u0027].apply(lambda x: datetime.datetime.strptime(x, \u0027%Y-%m-%d\u0027))\n",
        "\n",
        "# date \u003d data.index.tolist()\n",
        "# date \u003d [datetime.datetime.strptime(day, \u0027%Y-%m-%d\u0027) for day in date]\n",
        "\n",
        "p \u003d figure(title\u003d\u0027折线图-000001收盘价走势图\u0027, plot_height\u003d350, plot_width\u003d800, x_axis_type\u003d\"datetime\")\n",
        "p.xaxis.axis_label\u003d\u0027日期\u0027\n",
        "p.yaxis.axis_label\u003d\u0027收盘价（元）\u0027\n",
        "\n",
        "# p.line(date, data.close.tolist())\n",
        "p.line(data.date, data.close, color\u003d\u0027navy\u0027, alpha\u003d0.5)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 50,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\u003c!DOCTYPE html\u003e\n",
              "\u003chtml lang\u003d\"en-US\"\u003e\n",
              "\n",
              "\u003clink\n",
              "    href\u003d\"http://cdn.pydata.org/bokeh/dev/bokeh-0.13.0.min.css\"\n",
              "    rel\u003d\"stylesheet\" type\u003d\"text/css\"\n",
              "\u003e\n",
              "\u003cscript \n",
              "    src\u003d\"http://cdn.pydata.org/bokeh/dev/bokeh-0.13.0.min.js\"\n",
              "\u003e\u003c/script\u003e\n",
              "\n",
              "\u003cbody\u003e\n",
              "\n",
              "    \u003ch1\u003eHello Bokeh!\u003c/h1\u003e\n",
              "    \n",
              "    \u003cp\u003e 下图是000001的近期收盘价走势图 \u003c/p\u003e\n",
              "    \n",
              "    \n",
              "\u003cscript type\u003d\"text/javascript\"\u003e\n",
              "  (function() {\n",
              "    var fn \u003d function() {\n",
              "      Bokeh.safely(function() {\n",
              "        (function(root) {\n",
              "          function embed_document(root) {\n",
              "            \n",
              "          var docs_json \u003d \u0027{\"0f91bd38-3517-44c7-a73a-2833a3669a1a\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null},\"id\":\"11682\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"11740\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"11705\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"11738\",\"type\":\"YearsTicker\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":{\"__ndarray__\":\"AACAbk+sdUIAAEDUoax1QgAAADr0rHVCAADAn0atdUIAAIAFma11QgAAwDaQrnVCAACAnOKudUIAAEACNa91QgAAAGiHr3VCAADAzdmvdUIAAAD/0LB1QgAAwGQjsXVCAACAynWxdUIAAEAwyLF1QgAAAJYasnVCAADAkrazdUIAAID4CLR1QgAAQF5btHVCAACAj1K1dUIAAED1pLV1QgAAAFv3tXVCAADAwEm2dUIAAIAmnLZ1QgAAwFeTt3VCAACAveW3dUIAAEAjOLh1QgAAAImKuHVCAADA7ty4dUIAAAAg1Ll1QgAAwIUmunVCAACA63i6dUIAAEBRy7p1QgAAALcdu3VCAAAATme8dUIAAMCzubx1QgAAgBkMvXVCAABAf169dUIAAICwVb51QgAAQBaovnVCAAAAfPq+dUIAAMDhTL91QgAAgEefv3VCAADAeJbAdUIAAIDe6MB1QgAAQEQ7wXVCAAAAqo3BdUIAAMAP4MF1QgAAAEHXwnVCAADApinDdUIAAIAMfMN1QgAAQHLOw3VCAAAA2CDEdUIAAABvasV1QgAAwNS8xXVCAACAOg/GdUIAAECgYcZ1QgAAgNFYx3VCAABAN6vHdUIAAACd/cd1QgAAwAJQyHVCAACAaKLIdUIAAMCZmcl1QgAAgP/ryXVCAABAZT7KdUIAAADLkMp1QgAAwDDjynVCAAAAYtrLdUIAAMDHLMx1QgAAgC1/zHVCAABAk9HMdUIAAAD5I811QgAAQCobznVCAAAAkG3OdUIAAMD1v851QgAAgFsSz3VCAABAwWTPdUIAAIDyW9B1QgAAQFiu0HVCAAAAvgDRdUIAAMAjU9F1QgAAgIml0XVCAADAupzSdUIAAIAg79J1QgAAQIZB03VCAAAA7JPTdUIAAMBR5tN1QgAAAIPd1HVCAADA6C/VdUIAAIBOgtV1QgAAQLTU1XVCAAAAGifWdUIAAEBLHtd1Qg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MP1KFyPwixACtejcD0KLUA9CtejcD0uQEjhehSuxy1AcT0K16PwLUDhehSuR+EtQM3MzMzMzC1A16NwPQrXLUB7FK5H4fotQGZmZmZm5ixAH4XrUbieLEDNzMzMzEwtQAAAAAAAgCxAH4XrUbieLEAK16NwPYosQMP1KFyPQixAUrgehetRLEBmZmZmZuYsQJqZmZmZmSxA4XoUrkfhLEApXI/C9SgtQB+F61G4ni1A16NwPQpXLUA\u003d\",\"dtype\":\"float64\",\"shape\":[613]}},\"selected\":{\"id\":\"11740\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"11739\",\"type\":\"UnionRenderers\"}},\"id\":\"11715\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null},\"id\":\"11684\",\"type\":\"DataRange1d\"},{\"attributes\":{\"months\":[0,6]},\"id\":\"11737\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"11715\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"11716\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"11717\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"11719\",\"type\":\"CDSView\"}},\"id\":\"11718\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"days\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},\"id\":\"11730\",\"type\":\"DaysTicker\"},{\"attributes\":{\"months\":[0,2,4,6,8,10]},\"id\":\"11735\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"months\":[0,1,2,3,4,5,6,7,8,9,10,11]},\"id\":\"11734\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"base\":60,\"mantissas\":[1,2,5,10,15,20,30],\"max_interval\":1800000.0,\"min_interval\":1000.0,\"num_minor_ticks\":0},\"id\":\"11728\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{},\"id\":\"11686\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"11700\",\"type\":\"PanTool\"},{\"attributes\":{\"base\":24,\"mantissas\":[1,2,4,6,8,12],\"max_interval\":43200000.0,\"min_interval\":3600000.0,\"num_minor_ticks\":0},\"id\":\"11729\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"overlay\":{\"id\":\"11708\",\"type\":\"BoxAnnotation\"}},\"id\":\"11702\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"11688\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":0.5,\"line_color\":\"navy\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"11716\",\"type\":\"Line\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"11681\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11696\",\"type\":\"BasicTicker\"}},\"id\":\"11699\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"11700\",\"type\":\"PanTool\"},{\"id\":\"11701\",\"type\":\"WheelZoomTool\"},{\"id\":\"11702\",\"type\":\"BoxZoomTool\"},{\"id\":\"11703\",\"type\":\"SaveTool\"},{\"id\":\"11704\",\"type\":\"ResetTool\"},{\"id\":\"11705\",\"type\":\"HelpTool\"}]},\"id\":\"11706\",\"type\":\"Toolbar\"},{\"attributes\":{\"days\":[1,8,15,22]},\"id\":\"11732\",\"type\":\"DaysTicker\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"11717\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"11696\",\"type\":\"BasicTicker\"},{\"attributes\":{\"num_minor_ticks\":5,\"tickers\":[{\"id\":\"11727\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11728\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11729\",\"type\":\"AdaptiveTicker\"},{\"id\":\"11730\",\"type\":\"DaysTicker\"},{\"id\":\"11731\",\"type\":\"DaysTicker\"},{\"id\":\"11732\",\"type\":\"DaysTicker\"},{\"id\":\"11733\",\"type\":\"DaysTicker\"},{\"id\":\"11734\",\"type\":\"MonthsTicker\"},{\"id\":\"11735\",\"type\":\"MonthsTicker\"},{\"id\":\"11736\",\"type\":\"MonthsTicker\"},{\"id\":\"11737\",\"type\":\"MonthsTicker\"},{\"id\":\"11738\",\"type\":\"YearsTicker\"}]},\"id\":\"11691\",\"type\":\"DatetimeTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"11708\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"11715\",\"type\":\"ColumnDataSource\"}},\"id\":\"11719\",\"type\":\"CDSView\"},{\"attributes\":{\"days\":[1,4,7,10,13,16,19,22,25,28]},\"id\":\"11731\",\"type\":\"DaysTicker\"},{\"attributes\":{\"plot\":{\"id\":\"11681\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11691\",\"type\":\"DatetimeTicker\"}},\"id\":\"11694\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"\\\\u6536\\\\u76d8\\\\u4ef7\\\\uff08\\\\u5143\\\\uff09\",\"formatter\":{\"id\":\"11723\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"11681\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11696\",\"type\":\"BasicTicker\"}},\"id\":\"11695\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis_label\":\"\\\\u65e5\\\\u671f\",\"formatter\":{\"id\":\"11725\",\"type\":\"DatetimeTickFormatter\"},\"plot\":{\"id\":\"11681\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11691\",\"type\":\"DatetimeTicker\"}},\"id\":\"11690\",\"type\":\"DatetimeAxis\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"11720\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"11723\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"months\":[0,4,8]},\"id\":\"11736\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"below\":[{\"id\":\"11690\",\"type\":\"DatetimeAxis\"}],\"left\":[{\"id\":\"11695\",\"type\":\"LinearAxis\"}],\"plot_height\":350,\"plot_width\":800,\"renderers\":[{\"id\":\"11690\",\"type\":\"DatetimeAxis\"},{\"id\":\"11694\",\"type\":\"Grid\"},{\"id\":\"11695\",\"type\":\"LinearAxis\"},{\"id\":\"11699\",\"type\":\"Grid\"},{\"id\":\"11708\",\"type\":\"BoxAnnotation\"},{\"id\":\"11718\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"11720\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"11706\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"11682\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"11686\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"11684\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"11688\",\"type\":\"LinearScale\"}},\"id\":\"11681\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"mantissas\":[1,2,5],\"max_interval\":500.0,\"num_minor_ticks\":0},\"id\":\"11727\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{},\"id\":\"11701\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"11739\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"days\":[1,15]},\"id\":\"11733\",\"type\":\"DaysTicker\"},{\"attributes\":{},\"id\":\"11703\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"11725\",\"type\":\"DatetimeTickFormatter\"},{\"attributes\":{},\"id\":\"11704\",\"type\":\"ResetTool\"}],\"root_ids\":[\"11681\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}}\u0027;\n",
              "          var render_items \u003d [{\"docid\":\"0f91bd38-3517-44c7-a73a-2833a3669a1a\",\"roots\":{\"11681\":\"d637193d-1eca-4578-840d-5fd97ffcd41f\"}}];\n",
              "          root.Bokeh.embed.embed_items(docs_json, render_items);\n",
              "        \n",
              "          }\n",
              "          if (root.Bokeh !\u003d\u003d undefined) {\n",
              "            embed_document(root);\n",
              "          } else {\n",
              "            var attempts \u003d 0;\n",
              "            var timer \u003d setInterval(function(root) {\n",
              "              if (root.Bokeh !\u003d\u003d undefined) {\n",
              "                embed_document(root);\n",
              "                clearInterval(timer);\n",
              "              }\n",
              "              attempts++;\n",
              "              if (attempts \u003e 100) {\n",
              "                console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "                clearInterval(timer);\n",
              "              }\n",
              "            }, 10, root)\n",
              "          }\n",
              "        })(window);\n",
              "      });\n",
              "    };\n",
              "    if (document.readyState !\u003d \"loading\") fn();\n",
              "    else document.addEventListener(\"DOMContentLoaded\", fn);\n",
              "  })();\n",
              "\u003c/script\u003e\n",
              "    \n",
              "    \n",
              "\u003cdiv class\u003d\"bk-root\" id\u003d\"d637193d-1eca-4578-840d-5fd97ffcd41f\" data-root-id\u003d\"11681\"\u003e\u003c/div\u003e\n",
              "\n",
              "\u003c/body\u003e\n",
              "\n",
              "\u003c/html\u003e"
            ],
            "text/plain": [
              "\u003cIPython.core.display.HTML object\u003e"
            ]
          },
          "execution_count": 50,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# 写入html\n",
        "import tushare as ts\n",
        "import datetime\n",
        "import jinja2\n",
        "from bokeh.embed import components\n",
        "from IPython.display import HTML\n",
        "\n",
        "template \u003d jinja2.Template(\"\"\"\n",
        "\u003c!DOCTYPE html\u003e\n",
        "\u003chtml lang\u003d\"en-US\"\u003e\n",
        "\n",
        "\u003clink\n",
        "    href\u003d\"http://cdn.pydata.org/bokeh/dev/bokeh-0.13.0.min.css\"\n",
        "    rel\u003d\"stylesheet\" type\u003d\"text/css\"\n",
        "\u003e\n",
        "\u003cscript \n",
        "    src\u003d\"http://cdn.pydata.org/bokeh/dev/bokeh-0.13.0.min.js\"\n",
        "\u003e\u003c/script\u003e\n",
        "\n",
        "\u003cbody\u003e\n",
        "\n",
        "    \u003ch1\u003eHello Bokeh!\u003c/h1\u003e\n",
        "    \n",
        "    \u003cp\u003e 下图是000001的近期收盘价走势图 \u003c/p\u003e\n",
        "    \n",
        "    {{ script }}\n",
        "    \n",
        "    {{ div }}\n",
        "\n",
        "\u003c/body\u003e\n",
        "\n",
        "\u003c/html\u003e\n",
        "\"\"\")\n",
        "\n",
        "data \u003d ts.get_hist_data(\u0027000001\u0027)\n",
        "data \u003d data.sort_index()\n",
        "\n",
        "data[\u0027date\u0027] \u003d data.index\n",
        "data[\u0027date\u0027] \u003d data[\u0027date\u0027].apply(lambda x: datetime.datetime.strptime(x, \u0027%Y-%m-%d\u0027))\n",
        "\n",
        "# date \u003d data.index.tolist()\n",
        "# date \u003d [datetime.datetime.strptime(day, \u0027%Y-%m-%d\u0027) for day in date]\n",
        "\n",
        "p \u003d figure(plot_height\u003d350, plot_width\u003d800, x_axis_type\u003d\"datetime\")\n",
        "p.xaxis.axis_label\u003d\u0027日期\u0027\n",
        "p.yaxis.axis_label\u003d\u0027收盘价（元）\u0027\n",
        "\n",
        "# p.line(date, data.close.tolist())\n",
        "p.line(data.date, data.close, color\u003d\u0027navy\u0027, alpha\u003d0.5)\n",
        "\"\"\"\n",
        "from bokeh.io import export_png, export_svgs\n",
        "from IPython.display import Image, SVG\n",
        "\n",
        "# png\n",
        "export_png(p, filename\u003d\"plot.png\")\n",
        "Image(\u0027plot.png\u0027)\n",
        "\n",
        "# svg\n",
        "export_svgs(p, filename\u003d\"plot.svg\")\n",
        "SVG(\u0027plot.png\u0027)\n",
        "\"\"\"\n",
        "\n",
        "script, div \u003d components(p)\n",
        "\n",
        "HTML(template.render(script\u003dscript, div\u003ddiv))\n",
        "\"\"\"\n",
        "from flask import Flask\n",
        "app \u003d Flask(__name__)\n",
        "\n",
        "@app.route(\u0027/\u0027)\n",
        "def hello_bokeh():\n",
        "   return template.render(script\u003dscript, div\u003ddiv)\n",
        "\"\"\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"81aadec1-1a67-46d6-a43a-fa04f775792c\" data-root-id\u003d\"3193\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"81e3874f-87a7-4110-85d3-d4eba72f3fc2\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3203\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"3208\",\"type\":\"LinearAxis\"}],\"match_aspect\":true,\"renderers\":[{\"id\":\"3203\",\"type\":\"LinearAxis\"},{\"id\":\"3207\",\"type\":\"Grid\"},{\"id\":\"3208\",\"type\":\"LinearAxis\"},{\"id\":\"3212\",\"type\":\"Grid\"},{\"id\":\"3221\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"3192\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3215\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3195\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"3199\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3197\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"3201\",\"type\":\"LinearScale\"}},\"id\":\"3193\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"formatter\":{\"id\":\"3341\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"3193\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3204\",\"type\":\"BasicTicker\"}},\"id\":\"3203\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"3193\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3209\",\"type\":\"BasicTicker\"},\"visible\":false},\"id\":\"3212\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"3339\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"3193\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3209\",\"type\":\"BasicTicker\"}},\"id\":\"3208\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3204\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"3193\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3204\",\"type\":\"BasicTicker\"},\"visible\":false},\"id\":\"3207\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3199\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3341\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3342\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"3218\",\"type\":\"ColumnDataSource\"}},\"id\":\"3222\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"3197\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"3201\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3209\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3339\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"fill_color\":[\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#440255\",\"#45065A\",\"#440357\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#45065A\",\"#45065A\",\"#450558\",\"#45065A\",\"#440255\",\"#45085B\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440357\",\"#440357\",\"#450558\",\"#440357\",\"#440255\",\"#45065A\",\"#450558\",\"#440255\",\"#46095C\",\"#46095C\",\"#45065A\",\"#440357\",\"#45085B\",\"#45065A\",\"#450558\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#450558\",\"#45085B\",\"#450558\",\"#45085B\",\"#46095C\",\"#470F62\",\"#440255\",\"#45065A\",\"#450558\",\"#45085B\",\"#440255\",\"#440357\",\"#45085B\",\"#450558\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#440255\",\"#440357\",\"#450558\",\"#440255\",\"#46095C\",\"#471163\",\"#45065A\",\"#471163\",\"#440357\",\"#45065A\",\"#471567\",\"#46095C\",\"#46095C\",\"#450558\",\"#45065A\",\"#46095C\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#450558\",\"#45065A\",\"#45085B\",\"#470F62\",\"#470F62\",\"#450558\",\"#471163\",\"#460B5E\",\"#460E61\",\"#481A6C\",\"#470F62\",\"#471163\",\"#471466\",\"#48196B\",\"#45065A\",\"#460E61\",\"#460E61\",\"#45085B\",\"#46095C\",\"#46095C\",\"#46095C\",\"#450558\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#450558\",\"#470F62\",\"#450558\",\"#460E61\",\"#470F62\",\"#460E61\",\"#460E61\",\"#471567\",\"#471466\",\"#481D6F\",\"#472575\",\"#471567\",\"#481E70\",\"#481D6F\",\"#48196B\",\"#481C6E\",\"#470F62\",\"#471163\",\"#470F62\",\"#45085B\",\"#46095C\",\"#45065A\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#45085B\",\"#460E61\",\"#45065A\",\"#470F62\",\"#46095C\",\"#460B5E\",\"#481A6C\",\"#48196B\",\"#482172\",\"#472575\",\"#481C6E\",\"#472575\",\"#481C6E\",\"#482273\",\"#482273\",\"#482172\",\"#48196B\",\"#481A6C\",\"#481D6F\",\"#471163\",\"#45065A\",\"#470F62\",\"#450558\",\"#45085B\",\"#45065A\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#46095C\",\"#460B5E\",\"#460E61\",\"#471265\",\"#471265\",\"#481C6E\",\"#481D6F\",\"#481C6E\",\"#472B7A\",\"#472A79\",\"#46317E\",\"#46307D\",\"#472878\",\"#482071\",\"#462F7C\",\"#472A79\",\"#472676\",\"#481C6E\",\"#472C7B\",\"#481A6C\",\"#481E70\",\"#460B5E\",\"#470F62\",\"#460E61\",\"#46095C\",\"#440255\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#45065A\",\"#45085B\",\"#46095C\",\"#45065A\",\"#460E61\",\"#481C6E\",\"#471567\",\"#482172\",\"#472777\",\"#443781\",\"#46317E\",\"#423D84\",\"#433B83\",\"#453580\",\"#45347F\",\"#404487\",\"#423D84\",\"#472C7B\",\"#462F7C\",\"#48196B\",\"#481A6C\",\"#482273\",\"#460B5E\",\"#460B5E\",\"#46095C\",\"#460E61\",\"#440255\",\"#450558\",\"#440357\",\"#440357\",\"#440255\",\"#440357\",\"#45065A\",\"#440357\",\"#440357\",\"#450558\",\"#45065A\",\"#460E61\",\"#471265\",\"#471567\",\"#481A6C\",\"#472676\",\"#471466\",\"#46317E\",\"#423E85\",\"#414186\",\"#3B508A\",\"#423E85\",\"#39548B\",\"#3C4D8A\",\"#3F4587\",\"#3D4A89\",\"#3F4587\",\"#424085\",\"#46317E\",\"#481E70\",\"#472B7A\",\"#482273\",\"#471466\",\"#460B5E\",\"#440357\",\"#46095C\",\"#440357\",\"#440357\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45065A\",\"#46095C\",\"#460E61\",\"#450558\",\"#471567\",\"#481E70\",\"#46307D\",\"#45347F\",\"#423D84\",\"#433C84\",\"#3B508A\",\"#3A528B\",\"#2E6B8E\",\"#2F698D\",\"#37598C\",\"#31648D\",\"#3B508A\",\"#355D8C\",\"#3F4788\",\"#3D4A89\",\"#453580\",\"#472C7B\",\"#45327F\",\"#482172\",\"#481A6C\",\"#471265\",\"#46095C\",\"#460B5E\",\"#450558\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#460E61\",\"#45085B\",\"#470F62\",\"#481C6E\",\"#482273\",\"#472575\",\"#46307D\",\"#453580\",\"#39548B\",\"#3C4D8A\",\"#355D8C\",\"#3B508A\",\"#33618D\",\"#287A8E\",\"#365A8C\",\"#2A768E\",\"#355D8C\",\"#2E6C8E\",\"#38568B\",\"#32628D\",\"#3B508A\",\"#443781\",\"#433B83\",\"#45327F\",\"#453580\",\"#481D6F\",\"#471466\",\"#460B5E\",\"#460B5E\",\"#45065A\",\"#440357\",\"#45065A\",\"#440255\",\"#440357\",\"#440357\",\"#440357\",\"#450558\",\"#460E61\",\"#471669\",\"#481D6F\",\"#471567\",\"#472B7A\",\"#443781\",\"#3B508A\",\"#365A8C\",\"#37598C\",\"#2E6C8E\",\"#2F698D\",\"#23898D\",\"#22898D\",\"#2B738E\",\"#218D8C\",\"#2A758E\",\"#218C8D\",\"#2E6C8E\",\"#32638D\",\"#3F4587\",\"#424085\",\"#443781\",\"#443781\",\"#45347F\",\"#481E70\",\"#471466\",\"#46095C\",\"#450558\",\"#45085B\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440357\",\"#450558\",\"#45065A\",\"#460E61\",\"#481E70\",\"#472878\",\"#46307D\",\"#433B83\",\"#37598C\",\"#3A528B\",\"#30678D\",\"#2B738E\",\"#1E998A\",\"#218E8C\",\"#1E998A\",\"#1F958B\",\"#20918C\",\"#1E998A\",\"#25828E\",\"#32638D\",\"#2B738E\",\"#287A8E\",\"#3B518A\",\"#3C4D8A\",\"#45327F\",\"#482273\",\"#481E70\",\"#482071\",\"#471466\",\"#45085B\",\"#45065A\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#46095C\",\"#45085B\",\"#45085B\",\"#471265\",\"#482273\",\"#472878\",\"#453681\",\"#3E4989\",\"#355C8C\",\"#277E8E\",\"#25838D\",\"#23888D\",\"#22A784\",\"#1E988A\",\"#2BB17D\",\"#35B778\",\"#21A685\",\"#23A883\",\"#218E8C\",\"#218D8C\",\"#277D8E\",\"#2B738E\",\"#277C8E\",\"#3F4788\",\"#3E4888\",\"#433A83\",\"#462F7C\",\"#482172\",\"#471466\",\"#460B5E\",\"#450558\",\"#450558\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#45085B\",\"#450558\",\"#45065A\",\"#471567\",\"#482071\",\"#482071\",\"#472B7A\",\"#443781\",\"#3F4587\",\"#365A8C\",\"#365B8C\",\"#25838D\",\"#1F938B\",\"#23A982\",\"#1F928C\",\"#36B877\",\"#4BC26C\",\"#70CE56\",\"#36B877\",\"#1F928C\",\"#23A982\",\"#1E9E88\",\"#2E6C8E\",\"#287A8E\",\"#37598C\",\"#404387\",\"#433A83\",\"#472A79\",\"#481E70\",\"#471163\",\"#45085B\",\"#45085B\",\"#450558\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45085B\",\"#45065A\",\"#450558\",\"#481E70\",\"#471466\",\"#453681\",\"#433B83\",\"#3A528B\",\"#345F8D\",\"#29798E\",\"#228B8D\",\"#23888D\",\"#2BB17D\",\"#5BC862\",\"#4FC369\",\"#60C960\",\"#CAE01E\",\"#47C06E\",\"#47C06E\",\"#27AD80\",\"#27AD80\",\"#1E988A\",\"#218D8C\",\"#29788E\",\"#3A528B\",\"#3C4E8A\",\"#414186\",\"#472A79\",\"#482071\",\"#471163\",\"#471466\",\"#471265\",\"#45065A\",\"#45065A\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#450558\",\"#471466\",\"#481E70\",\"#471567\",\"#462F7C\",\"#45347F\",\"#424085\",\"#39548B\",\"#30688D\",\"#287A8E\",\"#1E9D88\",\"#28AE7F\",\"#47C06E\",\"#53C567\",\"#6BCD59\",\"#60C960\",\"#8BD546\",\"#90D643\",\"#59C764\",\"#39B976\",\"#38B976\",\"#23A982\",\"#277D8E\",\"#31658D\",\"#2F698D\",\"#433C84\",\"#443781\",\"#472777\",\"#472676\",\"#460B5E\",\"#471567\",\"#45085B\",\"#460B5E\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#450558\",\"#440357\",\"#45065A\",\"#460E61\",\"#470F62\",\"#472575\",\"#453580\",\"#433C84\",\"#355D8C\",\"#29798E\",\"#2B748E\",\"#1FA286\",\"#1E998A\",\"#2AB07E\",\"#79D151\",\"#88D547\",\"#88D547\",\"#FDE724\",\"#BDDE26\",\"#92D741\",\"#6DCE58\",\"#39B976\",\"#1FA286\",\"#24868D\",\"#2F6A8D\",\"#29788E\",\"#3A528B\",\"#45327F\",\"#414186\",\"#472676\",\"#471669\",\"#460B5E\",\"#46095C\",\"#450558\",\"#450558\",\"#440357\",\"#440255\",\"#440255\",\"#440357\",\"#45085B\",\"#471163\",\"#471567\",\"#471669\",\"#453681\",\"#433B83\",\"#3E4888\",\"#2C708E\",\"#287B8E\",\"#22898D\",\"#1E998A\",\"#20A485\",\"#55C666\",\"#CAE01E\",\"#A7DB33\",\"#C2DF22\",\"#B5DD2B\",\"#9AD83C\",\"#72CF55\",\"#44BE70\",\"#53C567\",\"#1E988A\",\"#277E8E\",\"#2C708E\",\"#2A758E\",\"#3B508A\",\"#472C7B\",\"#453580\",\"#481E70\",\"#460B5E\",\"#48196B\",\"#46095C\",\"#440357\",\"#45065A\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#450558\",\"#450558\",\"#471466\",\"#471163\",\"#471265\",\"#481D6F\",\"#433A83\",\"#3D4B89\",\"#365A8C\",\"#345F8D\",\"#2A758E\",\"#24848D\",\"#3BBA75\",\"#44BE70\",\"#88D547\",\"#B7DD29\",\"#8BD546\",\"#C7E01F\",\"#BDDE26\",\"#95D73F\",\"#38B976\",\"#3BBA75\",\"#20A485\",\"#20A485\",\"#24858D\",\"#365A8C\",\"#37588C\",\"#3F4788\",\"#433A83\",\"#481E70\",\"#48196B\",\"#470F62\",\"#46095C\",\"#460E61\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#471163\",\"#48196B\",\"#471265\",\"#472A79\",\"#453681\",\"#3C4E8A\",\"#38568B\",\"#345F8D\",\"#277C8E\",\"#218C8D\",\"#3DBB74\",\"#39B976\",\"#69CC5B\",\"#86D449\",\"#9AD83C\",\"#D7E219\",\"#9FD938\",\"#7ED24E\",\"#7CD24F\",\"#3EBC73\",\"#28AE7F\",\"#1F938B\",\"#20908C\",\"#29798E\",\"#355D8C\",\"#3C4E8A\",\"#453580\",\"#472B7A\",\"#482071\",\"#471567\",\"#460B5E\",\"#45065A\",\"#45085B\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#450558\",\"#46095C\",\"#46095C\",\"#471163\",\"#471163\",\"#453580\",\"#45347F\",\"#3D4A89\",\"#3C4D8A\",\"#355C8C\",\"#20918C\",\"#23A883\",\"#2FB37B\",\"#1FA386\",\"#4DC26B\",\"#CAE01E\",\"#90D643\",\"#BFDF24\",\"#ADDC30\",\"#57C665\",\"#83D34B\",\"#23A982\",\"#1F928C\",\"#218C8D\",\"#2C708E\",\"#2C718E\",\"#30678D\",\"#414186\",\"#443781\",\"#481E70\",\"#481A6C\",\"#45085B\",\"#45085B\",\"#450558\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#45085B\",\"#45065A\",\"#460E61\",\"#471265\",\"#481D6F\",\"#482071\",\"#472C7B\",\"#3B518A\",\"#365A8C\",\"#30678D\",\"#277C8E\",\"#1FA187\",\"#1FA187\",\"#4BC26C\",\"#60C960\",\"#D4E11A\",\"#79D151\",\"#69CC5B\",\"#5EC961\",\"#49C16D\",\"#47C06E\",\"#2FB37B\",\"#23898D\",\"#25828E\",\"#32628D\",\"#3E4888\",\"#414186\",\"#433A83\",\"#46317E\",\"#482273\",\"#460B5E\",\"#471466\",\"#460B5E\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45085B\",\"#471163\",\"#460B5E\",\"#482273\",\"#481A6C\",\"#472575\",\"#462F7C\",\"#423D84\",\"#2F698D\",\"#2E6D8E\",\"#31648D\",\"#1E9B89\",\"#2BB17D\",\"#36B877\",\"#44BE70\",\"#90D643\",\"#7ED24E\",\"#72CF55\",\"#74D054\",\"#24AA82\",\"#23A883\",\"#228B8D\",\"#22898D\",\"#2F698D\",\"#355C8C\",\"#3C4E8A\",\"#423D84\",\"#472A79\",\"#481E70\",\"#48196B\",\"#46095C\",\"#471163\",\"#45065A\",\"#440255\",\"#440357\",\"#440357\",\"#440255\",\"#440357\",\"#440255\",\"#450558\",\"#460E61\",\"#440357\",\"#45085B\",\"#472676\",\"#482071\",\"#46307D\",\"#423D84\",\"#3B518A\",\"#2B738E\",\"#37588C\",\"#2C718E\",\"#1E998A\",\"#1EA087\",\"#26AC81\",\"#38B976\",\"#2EB27C\",\"#2EB27C\",\"#1FA187\",\"#36B877\",\"#1E9A89\",\"#228A8D\",\"#24868D\",\"#2E6D8E\",\"#365B8C\",\"#3D4A89\",\"#404387\",\"#472C7B\",\"#46307D\",\"#481D6F\",\"#471265\",\"#470F62\",\"#45085B\",\"#450558\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45065A\",\"#471567\",\"#46095C\",\"#471567\",\"#481E70\",\"#472777\",\"#443781\",\"#39548B\",\"#38568B\",\"#2A768E\",\"#32638D\",\"#1E998A\",\"#25828E\",\"#23A982\",\"#1E998A\",\"#20918C\",\"#1FA386\",\"#25AB81\",\"#218D8C\",\"#277E8E\",\"#26808E\",\"#2A768E\",\"#355D8C\",\"#3F4587\",\"#45327F\",\"#462F7C\",\"#472878\",\"#471163\",\"#471163\",\"#46095C\",\"#45065A\",\"#45065A\",\"#440255\",\"#440255\",\"#460B5E\",\"#45065A\",\"#45065A\",\"#470F62\",\"#482273\",\"#472777\",\"#462F7C\",\"#3E4888\",\"#3E4888\",\"#31658D\",\"#33608D\",\"#31658D\",\"#1E9D88\",\"#218C8D\",\"#218D8C\",\"#20918C\",\"#20918C\",\"#218D8C\",\"#23888D\",\"#23888D\",\"#277C8E\",\"#31658D\",\"#2D6E8E\",\"#3F4587\",\"#423D84\",\"#423E85\",\"#472878\",\"#471163\",\"#460B5E\",\"#471466\",\"#460E61\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#450558\",\"#450558\",\"#460B5E\",\"#471567\",\"#481C6E\",\"#472676\",\"#472B7A\",\"#433A83\",\"#37588C\",\"#3B508A\",\"#32628D\",\"#2C728E\",\"#26818E\",\"#22898D\",\"#29798E\",\"#20918C\",\"#1E9B89\",\"#24868D\",\"#2A758E\",\"#2B748E\",\"#32638D\",\"#31658D\",\"#443781\",\"#45327F\",\"#45327F\",\"#472878\",\"#481C6E\",\"#48196B\",\"#45085B\",\"#45065A\",\"#460B5E\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45065A\",\"#46095C\",\"#460B5E\",\"#481E70\",\"#481A6C\",\"#472B7A\",\"#453681\",\"#433A83\",\"#3A538B\",\"#37588C\",\"#365A8C\",\"#365B8C\",\"#345F8D\",\"#355C8C\",\"#2E6D8E\",\"#31648D\",\"#30678D\",\"#30678D\",\"#365A8C\",\"#3D4A89\",\"#443781\",\"#453580\",\"#46317E\",\"#462F7C\",\"#471265\",\"#460E61\",\"#460E61\",\"#450558\",\"#450558\",\"#440255\",\"#440255\",\"#440357\",\"#450558\",\"#440255\",\"#471466\",\"#46095C\",\"#471163\",\"#471567\",\"#481E70\",\"#472C7B\",\"#46317E\",\"#472A79\",\"#433C84\",\"#404487\",\"#3C4E8A\",\"#37588C\",\"#3B518A\",\"#39548B\",\"#2F6A8D\",\"#37588C\",\"#3B518A\",\"#3D4A89\",\"#423E85\",\"#45327F\",\"#45327F\",\"#472676\",\"#472676\",\"#471669\",\"#471163\",\"#470F62\",\"#45085B\",\"#45085B\",\"#45065A\",\"#440357\",\"#440255\",\"#450558\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#45085B\",\"#470F62\",\"#460E61\",\"#471567\",\"#472575\",\"#481E70\",\"#453681\",\"#45327F\",\"#453681\",\"#3F4788\",\"#3D4A89\",\"#3F4788\",\"#3C4D8A\",\"#37598C\",\"#3F4788\",\"#38568B\",\"#3E4888\",\"#433B83\",\"#433C84\",\"#472A79\",\"#482172\",\"#48196B\",\"#471163\",\"#470F62\",\"#46095C\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#440255\",\"#450558\",\"#450558\",\"#470F62\",\"#45085B\",\"#45065A\",\"#450558\",\"#481A6C\",\"#48196B\",\"#482273\",\"#481E70\",\"#472676\",\"#453681\",\"#424085\",\"#433C84\",\"#3B518A\",\"#414186\",\"#3E4989\",\"#424085\",\"#472A79\",\"#46317E\",\"#45327F\",\"#482273\",\"#472878\",\"#471466\",\"#471163\",\"#460E61\",\"#460B5E\",\"#440357\",\"#450558\",\"#440255\",\"#440357\",\"#440255\",\"#440357\",\"#440357\",\"#440357\",\"#460E61\",\"#460B5E\",\"#471567\",\"#470F62\",\"#460E61\",\"#482071\",\"#481E70\",\"#481E70\",\"#472676\",\"#472C7B\",\"#433C84\",\"#46317E\",\"#46317E\",\"#453580\",\"#45347F\",\"#472A79\",\"#481D6F\",\"#472676\",\"#472777\",\"#471567\",\"#460E61\",\"#45085B\",\"#45085B\",\"#460E61\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#450558\",\"#45085B\",\"#45085B\",\"#470F62\",\"#460E61\",\"#460B5E\",\"#471163\",\"#48196B\",\"#481E70\",\"#481D6F\",\"#481D6F\",\"#481A6C\",\"#481D6F\",\"#472C7B\",\"#472A79\",\"#472B7A\",\"#481D6F\",\"#481E70\",\"#481A6C\",\"#481A6C\",\"#48196B\",\"#46095C\",\"#460B5E\",\"#460B5E\",\"#450558\",\"#45065A\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#45085B\",\"#460E61\",\"#471163\",\"#460B5E\",\"#471163\",\"#471567\",\"#481E70\",\"#481C6E\",\"#481A6C\",\"#471466\",\"#48196B\",\"#471669\",\"#471567\",\"#471265\",\"#481A6C\",\"#48196B\",\"#460B5E\",\"#46095C\",\"#46095C\",\"#46095C\",\"#440357\",\"#450558\",\"#46095C\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#440357\",\"#470F62\",\"#470F62\",\"#45085B\",\"#46095C\",\"#471265\",\"#48196B\",\"#470F62\",\"#481C6E\",\"#471265\",\"#470F62\",\"#481C6E\",\"#470F62\",\"#471567\",\"#471466\",\"#460B5E\",\"#45085B\",\"#440357\",\"#45085B\",\"#440357\",\"#45085B\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#45085B\",\"#450558\",\"#45065A\",\"#460B5E\",\"#460B5E\",\"#470F62\",\"#460B5E\",\"#46095C\",\"#45085B\",\"#460E61\",\"#45085B\",\"#460B5E\",\"#471466\",\"#460B5E\",\"#450558\",\"#46095C\",\"#450558\",\"#450558\",\"#45065A\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440357\",\"#45065A\",\"#46095C\",\"#450558\",\"#45065A\",\"#45085B\",\"#440357\",\"#45085B\",\"#450558\",\"#440357\",\"#45085B\",\"#440357\",\"#46095C\",\"#440255\",\"#45065A\",\"#440357\",\"#440357\",\"#450558\",\"#440357\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#450558\",\"#440357\",\"#440357\",\"#46095C\",\"#45085B\",\"#440357\",\"#470F62\",\"#440357\",\"#45065A\",\"#450558\",\"#440255\",\"#45065A\",\"#440255\",\"#450558\",\"#450558\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#450558\",\"#45065A\",\"#440357\",\"#45065A\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#450558\",\"#440357\",\"#440357\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\",\"#440255\"],\"q\":[-29,-27,-26,-24,-24,-24,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-22,-22,-22,-22,-22,-22,-22,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-18,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,24,24,24,25,25,25,26,26,27,27,28],\"r\":[25,19,11,7,14,18,-6,4,9,10,11,12,13,15,16,22,-2,1,5,13,14,17,22,-4,1,4,6,7,8,9,11,12,13,14,15,16,18,19,1,4,5,6,7,8,10,11,12,14,15,16,17,22,-5,-2,-1,0,2,4,5,6,7,9,10,11,12,13,14,15,16,17,18,20,21,-3,-2,3,4,5,6,7,8,9,10,11,12,13,15,16,18,19,20,22,30,-6,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,-8,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,25,26,-11,-10,-8,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,-10,-8,-6,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,-13,-11,-9,-7,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,27,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,25,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,-15,-13,-12,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,-15,-14,-13,-12,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-15,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-16,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,-18,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,23,-20,-18,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,-21,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,21,-20,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,-24,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20,-22,-20,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,19,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,-26,-25,-23,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,19,-25,-23,-22,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,-22,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,12,18,-23,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,-27,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,11,12,-24,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,-23,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,7,8,10,12,13,-25,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,-25,-24,-21,-20,-19,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,7,8,-23,-22,-21,-20,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,6,7,-26,-22,-21,-20,-18,-17,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,3,4,5,10,-24,-23,-20,-17,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,4,-26,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-8,-7,-6,-5,-4,-3,-2,-1,0,2,-20,-19,-16,-15,-14,-12,-11,-10,-9,-7,-5,-3,-2,-1,-20,-19,-17,-13,-12,-10,-9,-8,-3,-2,-1,2,-21,-20,-17,-16,-15,-14,-13,-11,-10,-9,-6,-4,-20,-16,-15,-12,-11,-10,-9,-5,-3,-16,-12,-8,-23,-16,-8,-19,-16,-18,-12,-22]},\"selected\":{\"id\":\"3343\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"3342\",\"type\":\"UnionRenderers\"}},\"id\":\"3218\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u516d\\u89d2\\u5e73\\u94fa\"},\"id\":\"3192\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"3343\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"q\":{\"field\":\"q\"},\"r\":{\"field\":\"r\"},\"size\":0.1},\"id\":\"3220\",\"type\":\"HexTile\"},{\"attributes\":{\"callback\":null},\"id\":\"3195\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"3214\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"3213\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"3218\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3219\",\"type\":\"HexTile\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3220\",\"type\":\"HexTile\"},\"selection_glyph\":null,\"view\":{\"id\":\"3222\",\"type\":\"CDSView\"}},\"id\":\"3221\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"field\":\"fill_color\"},\"q\":{\"field\":\"q\"},\"r\":{\"field\":\"r\"},\"size\":0.1},\"id\":\"3219\",\"type\":\"HexTile\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3213\",\"type\":\"WheelZoomTool\"},{\"id\":\"3214\",\"type\":\"ResetTool\"}]},\"id\":\"3215\",\"type\":\"Toolbar\"}],\"root_ids\":[\"3193\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"81e3874f-87a7-4110-85d3-d4eba72f3fc2\",\"roots\":{\"3193\":\"81aadec1-1a67-46d6-a43a-fa04f775792c\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "3193"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 六角平铺\n",
        "from bokeh.palettes import Viridis256\n",
        "from bokeh.util.hex import hexbin\n",
        "\n",
        "n \u003d 50000\n",
        "x \u003d np.random.standard_normal(n)\n",
        "y \u003d np.random.standard_normal(n)\n",
        "\n",
        "bins \u003d hexbin(x, y, 0.1)\n",
        "color \u003d [Viridis256[int(i)] for i in bins.counts / max(bins.counts) * 255]\n",
        "\n",
        "p \u003d figure(tools\u003d\u0027wheel_zoom,reset\u0027, match_aspect\u003dTrue, title\u003d\u0027六角平铺\u0027)\n",
        "p.grid.visible \u003d False\n",
        "\n",
        "p.hex_tile(bins.q, bins.r, size\u003d0.1, line_color\u003dNone, fill_color\u003dcolor)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 22,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"cd72325d-6a45-4b69-b598-f4ed2398209b\" data-root-id\u003d\"3844\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"a1d65fc6-fa78-4883-a501-a1c8ae38a813\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3854\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"3859\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"3854\",\"type\":\"LinearAxis\"},{\"id\":\"3858\",\"type\":\"Grid\"},{\"id\":\"3859\",\"type\":\"LinearAxis\"},{\"id\":\"3863\",\"type\":\"Grid\"},{\"id\":\"3872\",\"type\":\"BoxAnnotation\"},{\"id\":\"3884\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"3843\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"3870\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3846\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"3850\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3848\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"3852\",\"type\":\"LinearScale\"}},\"id\":\"3844\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3864\",\"type\":\"PanTool\"},{\"id\":\"3865\",\"type\":\"WheelZoomTool\"},{\"id\":\"3866\",\"type\":\"BoxZoomTool\"},{\"id\":\"3867\",\"type\":\"SaveTool\"},{\"id\":\"3868\",\"type\":\"ResetTool\"},{\"id\":\"3869\",\"type\":\"HelpTool\"}]},\"id\":\"3870\",\"type\":\"Toolbar\"},{\"attributes\":{\"color_mapper\":{\"id\":\"3880\",\"type\":\"LinearColorMapper\"},\"dh\":{\"units\":\"data\",\"value\":10},\"dw\":{\"units\":\"data\",\"value\":10},\"image\":{\"field\":\"image\"},\"x\":{\"value\":0},\"y\":{\"value\":0}},\"id\":\"3881\",\"type\":\"Image\"},{\"attributes\":{},\"id\":\"3868\",\"type\":\"ResetTool\"},{\"attributes\":{\"overlay\":{\"id\":\"3872\",\"type\":\"BoxAnnotation\"}},\"id\":\"3866\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"4027\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"3844\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3860\",\"type\":\"BasicTicker\"}},\"id\":\"3859\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3865\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"palette\":[\"#5e4fa2\",\"#3288bd\",\"#66c2a5\",\"#abdda4\",\"#e6f598\",\"#ffffbf\",\"#fee08b\",\"#fdae61\",\"#f46d43\",\"#d53e4f\",\"#9e0142\"]},\"id\":\"3882\",\"type\":\"LinearColorMapper\"},{\"attributes\":{\"plot\":{\"id\":\"3844\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3855\",\"type\":\"BasicTicker\"}},\"id\":\"3858\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3855\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3852\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u989c\\u8272\\u7ec4\\u5408\"},\"id\":\"3843\",\"type\":\"Title\"},{\"attributes\":{\"palette\":[\"#5e4fa2\",\"#3288bd\",\"#66c2a5\",\"#abdda4\",\"#e6f598\",\"#ffffbf\",\"#fee08b\",\"#fdae61\",\"#f46d43\",\"#d53e4f\",\"#9e0142\"]},\"id\":\"3880\",\"type\":\"LinearColorMapper\"},{\"attributes\":{\"source\":{\"id\":\"3879\",\"type\":\"ColumnDataSource\"}},\"id\":\"3885\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4027\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"3846\",\"type\":\"Range1d\"},{\"attributes\":{\"color_mapper\":{\"id\":\"3882\",\"type\":\"LinearColorMapper\"},\"dh\":{\"units\":\"data\",\"value\":10},\"dw\":{\"units\":\"data\",\"value\":10},\"image\":{\"field\":\"image\"},\"x\":{\"value\":0},\"y\":{\"value\":0}},\"id\":\"3883\",\"type\":\"Image\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"3848\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"4031\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"3850\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"3860\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"3844\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3860\",\"type\":\"BasicTicker\"}},\"id\":\"3863\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3864\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"image\":[{\"__ndarray__\":\"AAAAAAAAAABQU0tEm63sPykxQVVxcuk/NJcb8IdkyL/Z0wWSr9vuv8JU6/iCSOW/W/DDABjy1z/tdhDWOejvP7BdRrjhVuA/Uk/z9Z5o4b8AAAAAAAAAACkxQVVxctk/g21ESHmU1j/CihLz+KS1v4w68vSkYdu/r9ujkaPi0r9bREq6bT/FP95VqLjtT9w/Lk86wDX/zD/alktQAeXOvwAAAAAAAACAjhwpoF5j4b/Z0wWSr9vev0P6fy1hlL0/q5TRqr614j8jkQnaF8/ZP1PsfrObCc2/C1Jv95BY47/yMApgVtDTv7C6SPhIHNU/AAAAAAAAAICBgqNzECfsvwhUmx4P++i/W/DDABjyxz8e5S2N6kruP2/Hw4ap5OQ/IzX68cCB1799/jj5iFLvv3yIWes5CuC/oUPR7PIW4T8AAAAAAAAAgOTdyPnBXs6/93G+qcryyr/iHCmO9NSpP7BdRrjhVtA/9wewnPiJxj/c36ssxFu5vwWiztkS5dC/e4mKcatNwb9nRB81j2/CPwAAAAAAAAAAAOYzyV1q5T9argvprQDjP/Cm9TkfN8K/UFEfHR0L578gKWxgYsnfvxaXg2aq4dE/IOBAl6XT5z8lEXSXKGfYPxPsb139/9m/AAAAAAAAAADW5X1nXpjqP8UYJqVImec/EtPY8/mexr8krdba6Z3sv8eHCRHGvOO/HI9A2dk01j8jJePr8pbtP+cY14kjTt4/snqgI+0k4L8AAAAAAAAAAO6Vkd9Wd7E/GivAFyD/rj+lqMrMWbaNv45ZA4c7y7K/QxAF4Lvsqb8cOvry9CqdP9eeV9LIbrM/eB2KyBfnoz8zc9SbhzSlvwAAAAAAAACAIeMBZmyo6L+nEGcwN+Hlvw8xRzYk+cQ/ejGjtUSI6j9j7sBHtkziP2xJqyC/ltS/d7HCxylv67+Uv7tIAhncv8v74TW9790/AAAAAAAAAIBqQ1kMIhDov5QZ7FkVWuW/3y29sZt3xD/cJTPGZuTpP8/dTeOw2+E/0ikzT5YX1L9heP7OucXqv9GqtFJ5a9u/3zxd9dg23T8\u003d\",\"dtype\":\"float64\",\"shape\":[10,10]}]},\"selected\":{\"id\":\"4032\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4031\",\"type\":\"UnionRenderers\"}},\"id\":\"3879\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"formatter\":{\"id\":\"4029\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"3844\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3855\",\"type\":\"BasicTicker\"}},\"id\":\"3854\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3872\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4029\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4032\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"3879\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3881\",\"type\":\"Image\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3883\",\"type\":\"Image\"},\"selection_glyph\":null,\"view\":{\"id\":\"3885\",\"type\":\"CDSView\"}},\"id\":\"3884\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3867\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"3869\",\"type\":\"HelpTool\"}],\"root_ids\":[\"3844\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"a1d65fc6-fa78-4883-a501-a1c8ae38a813\",\"roots\":{\"3844\":\"cd72325d-6a45-4b69-b598-f4ed2398209b\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "3844"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 图像颜色\n",
        "N \u003d 500\n",
        "x \u003d np.linspace(0, 10, 10)\n",
        "y \u003d np.linspace(0, 10, 10)\n",
        "# 分别生成横的重复x 和 纵的重复y\n",
        "xx, yy \u003d np.meshgrid(x, y)\n",
        "\n",
        "image \u003d np.sin(xx) * np.cos(yy)\n",
        "\n",
        "p \u003d figure(x_range\u003d(0, 10), y_range\u003d(0, 10), title\u003d\u0027颜色组合\u0027)\n",
        "p.image(image\u003d[image], x\u003d0, y\u003d0, dw\u003d10, dh\u003d10, palette\u003d\u0027Spectral11\u0027)\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 23,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"baa1c99c-ff97-4907-842e-c674f4dbf145\" data-root-id\u003d\"4082\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"d4c426fc-549e-4c09-b5b0-0555049a959f\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4092\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"4097\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"4092\",\"type\":\"LinearAxis\"},{\"id\":\"4096\",\"type\":\"Grid\"},{\"id\":\"4097\",\"type\":\"LinearAxis\"},{\"id\":\"4101\",\"type\":\"Grid\"},{\"id\":\"4110\",\"type\":\"BoxAnnotation\"},{\"id\":\"4120\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"4081\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"4108\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"4084\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"4088\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"4086\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"4090\",\"type\":\"LinearScale\"}},\"id\":\"4082\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4102\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4103\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"dh\":{\"field\":\"dh\",\"units\":\"data\"},\"dw\":{\"field\":\"dw\",\"units\":\"data\"},\"image\":{\"field\":\"image\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4119\",\"type\":\"ImageRGBA\"},{\"attributes\":{\"overlay\":{\"id\":\"4110\",\"type\":\"BoxAnnotation\"}},\"id\":\"4104\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4273\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4105\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"dh\":[10],\"dw\":[10],\"image\":[{\"__ndarray__\":\"AJ4A/wCeDP8Anhn/AJ4m/wCeM/8Anj//AJ5M/wCeWf8Anmb/AJ5y/wCef/8Anoz/AJ6Z/wCepf8AnrL/AJ6//wCezP8Antj/AJ7l/wCe8v8MngD/DJ4M/wyeGf8Mnib/DJ4z/wyeP/8Mnkz/DJ5Z/wyeZv8MnnL/DJ5//wyejP8Mnpn/DJ6l/wyesv8Mnr//DJ7M/wye2P8MnuX/DJ7y/xmeAP8Zngz/GZ4Z/xmeJv8ZnjP/GZ4//xmeTP8Znln/GZ5m/xmecv8Znn//GZ6M/xmemf8ZnqX/GZ6y/xmev/8Znsz/GZ7Y/xme5f8ZnvL/Jp4A/yaeDP8mnhn/Jp4m/yaeM/8mnj//Jp5M/yaeWf8mnmb/J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kz/pZ5Z/6WeZv+lnnL/pZ5//6WejP+lnpn/pZ6l/6Wesv+lnr//pZ7M/6We2P+lnuX/pZ7y/7KeAP+yngz/sp4Z/7KeJv+ynjP/sp4//7KeTP+ynln/sp5m/7Kecv+ynn//sp6M/7Kemf+ynqX/sp6y/7Kev/+ynsz/sp7Y/7Ke5f+ynvL/v54A/7+eDP+/nhn/v54m/7+eM/+/nj//v55M/7+eWf+/nmb/v55y/7+ef/+/noz/v56Z/7+epf+/nrL/v56//7+ezP+/ntj/v57l/7+e8v/MngD/zJ4M/8yeGf/Mnib/zJ4z/8yeP//Mnkz/zJ5Z/8yeZv/MnnL/zJ5//8yejP/Mnpn/zJ6l/8yesv/Mnr//zJ7M/8ye2P/MnuX/zJ7y/9ieAP/Yngz/2J4Z/9ieJv/YnjP/2J4//9ieTP/Ynln/2J5m/9iecv/Ynn//2J6M/9iemf/YnqX/2J6y/9iev//Ynsz/2J7Y/9ie5f/YnvL/5Z4A/+WeDP/lnhn/5Z4m/+WeM//lnj//5Z5M/+WeWf/lnmb/5Z5y/+Wef//lnoz/5Z6Z/+Wepf/lnrL/5Z6//+WezP/lntj/5Z7l/+We8v/yngD/8p4M//KeGf/ynib/8p4z//KeP//ynkz/8p5Z//KeZv/ynnL/8p5///KejP/ynpn/8p6l//Kesv/ynr//8p7M//Ke2P/ynuX/8p7y/w\u003d\u003d\",\"dtype\":\"uint32\",\"shape\":[20,20]}],\"x\":[0],\"y\":[0]},\"selected\":{\"id\":\"4276\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4275\",\"type\":\"UnionRenderers\"}},\"id\":\"4117\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u989c\\u8272\\u7ec4\\u5408\"},\"id\":\"4081\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"4106\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4107\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"4084\",\"type\":\"Range1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4102\",\"type\":\"PanTool\"},{\"id\":\"4103\",\"type\":\"WheelZoomTool\"},{\"id\":\"4104\",\"type\":\"BoxZoomTool\"},{\"id\":\"4105\",\"type\":\"SaveTool\"},{\"id\":\"4106\",\"type\":\"ResetTool\"},{\"id\":\"4107\",\"type\":\"HelpTool\"}]},\"id\":\"4108\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"4086\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"4117\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4118\",\"type\":\"ImageRGBA\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4119\",\"type\":\"ImageRGBA\"},\"selection_glyph\":null,\"view\":{\"id\":\"4121\",\"type\":\"CDSView\"}},\"id\":\"4120\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4088\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4110\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4090\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"4117\",\"type\":\"ColumnDataSource\"}},\"id\":\"4121\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"4273\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4082\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4093\",\"type\":\"BasicTicker\"}},\"id\":\"4092\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4271\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4093\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4275\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"plot\":{\"id\":\"4082\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4093\",\"type\":\"BasicTicker\"}},\"id\":\"4096\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"4271\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4082\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4098\",\"type\":\"BasicTicker\"}},\"id\":\"4097\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4098\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"4082\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4098\",\"type\":\"BasicTicker\"}},\"id\":\"4101\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4276\",\"type\":\"Selection\"},{\"attributes\":{\"dh\":{\"field\":\"dh\",\"units\":\"data\"},\"dw\":{\"field\":\"dw\",\"units\":\"data\"},\"image\":{\"field\":\"image\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4118\",\"type\":\"ImageRGBA\"}],\"root_ids\":[\"4082\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"d4c426fc-549e-4c09-b5b0-0555049a959f\",\"roots\":{\"4082\":\"baa1c99c-ff97-4907-842e-c674f4dbf145\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "4082"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 图像颜色\n",
        "N \u003d 20\n",
        "img \u003d np.empty((N, N), dtype\u003dnp.uint32)\n",
        "\n",
        "view \u003d img.view(dtype\u003dnp.uint8).reshape((N, N, 4))\n",
        "for i in range(N):\n",
        "    for j in range(N):\n",
        "        view[i][j][0] \u003d int(i / N * 255)\n",
        "        view[i][j][1] \u003d 158\n",
        "        view[i][j][2] \u003d int(j / N * 255)\n",
        "        view[i][j][3] \u003d 255\n",
        "\n",
        "p \u003d figure(x_range\u003d[0, 10], y_range\u003d[0, 10], title\u003d\u0027颜色组合\u0027)\n",
        "p.image_rgba(image\u003d[img], x\u003d[0], y\u003d[0], dw\u003d[10], dh\u003d[10])\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 24,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"f95c790d-ef88-40df-9c1b-007121d4e68a\" data-root-id\u003d\"4326\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"658bd392-abeb-424b-8aec-1125c5de0697\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4336\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"4341\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"4336\",\"type\":\"LinearAxis\"},{\"id\":\"4340\",\"type\":\"Grid\"},{\"id\":\"4341\",\"type\":\"LinearAxis\"},{\"id\":\"4345\",\"type\":\"Grid\"},{\"id\":\"4354\",\"type\":\"BoxAnnotation\"},{\"id\":\"4364\",\"type\":\"GlyphRenderer\"},{\"id\":\"4369\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"4325\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"4352\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"4328\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"4332\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"4330\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"4334\",\"type\":\"LinearScale\"}},\"id\":\"4326\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4354\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4530\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4367\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null},\"id\":\"4328\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"4535\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4342\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4334\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4534\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"x\",\"formatter\":{\"id\":\"4530\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4326\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4337\",\"type\":\"BasicTicker\"}},\"id\":\"4336\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4533\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4337\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"4330\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"4532\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"plot\":{\"id\":\"4326\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4337\",\"type\":\"BasicTicker\"}},\"id\":\"4340\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"4366\",\"type\":\"ColumnDataSource\"}},\"id\":\"4370\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"y\",\"formatter\":{\"id\":\"4528\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4326\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4342\",\"type\":\"BasicTicker\"}},\"id\":\"4341\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"4326\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4342\",\"type\":\"BasicTicker\"}},\"id\":\"4345\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[6,7,8,7,3]},\"selected\":{\"id\":\"4533\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4532\",\"type\":\"UnionRenderers\"}},\"id\":\"4361\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4351\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4368\",\"type\":\"Circle\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4363\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"4366\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4367\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4368\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"4370\",\"type\":\"CDSView\"}},\"id\":\"4369\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"4361\",\"type\":\"ColumnDataSource\"}},\"id\":\"4365\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"#1f77b4\",\"line_width\":2,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4362\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"4528\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[1,2,3,4,5],\"y\":[6,7,8,7,3]},\"selected\":{\"id\":\"4535\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4534\",\"type\":\"UnionRenderers\"}},\"id\":\"4366\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u591a\\u56fe\\u7ec4\\u5408\"},\"id\":\"4325\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"4361\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4362\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4363\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"4365\",\"type\":\"CDSView\"}},\"id\":\"4364\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4346\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4347\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"overlay\":{\"id\":\"4354\",\"type\":\"BoxAnnotation\"}},\"id\":\"4348\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4349\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4332\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4350\",\"type\":\"ResetTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4346\",\"type\":\"PanTool\"},{\"id\":\"4347\",\"type\":\"WheelZoomTool\"},{\"id\":\"4348\",\"type\":\"BoxZoomTool\"},{\"id\":\"4349\",\"type\":\"SaveTool\"},{\"id\":\"4350\",\"type\":\"ResetTool\"},{\"id\":\"4351\",\"type\":\"HelpTool\"}]},\"id\":\"4352\",\"type\":\"Toolbar\"}],\"root_ids\":[\"4326\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"658bd392-abeb-424b-8aec-1125c5de0697\",\"roots\":{\"4326\":\"f95c790d-ef88-40df-9c1b-007121d4e68a\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "4326"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 多图组合\n",
        "x \u003d [1, 2, 3, 4, 5]\n",
        "y \u003d [6, 7, 8, 7, 3]\n",
        "\n",
        "p \u003d figure(plot_width\u003d400, plot_height\u003d400, title\u003d\u0027多图组合\u0027)\n",
        "\n",
        "p.line(x, y, line_width\u003d2)\n",
        "p.circle(x, y, fill_color\u003d\u0027red\u0027, size\u003d8)\n",
        "\n",
        "p.xaxis.axis_label\u003d\u0027x\u0027\n",
        "p.yaxis.axis_label\u003d\u0027y\u0027\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 27,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"19771810-0eea-4d1f-908c-78579468094a\" data-root-id\u003d\"4637\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"e8ac3669-9065-488c-9228-1832137140f3\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"4647\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"4651\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"renderers\":[{\"id\":\"4647\",\"type\":\"CategoricalAxis\"},{\"id\":\"4650\",\"type\":\"Grid\"},{\"id\":\"4651\",\"type\":\"LinearAxis\"},{\"id\":\"4655\",\"type\":\"Grid\"},{\"id\":\"4664\",\"type\":\"BoxAnnotation\"},{\"id\":\"4674\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"4636\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"4662\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"4639\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"4643\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"4641\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"4645\",\"type\":\"LinearScale\"}},\"id\":\"4637\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4652\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"4637\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4652\",\"type\":\"BasicTicker\"}},\"id\":\"4655\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"4672\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"4845\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"4671\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4672\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4673\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"4675\",\"type\":\"CDSView\"}},\"id\":\"4674\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4656\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4657\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"top\":[5,3,4,2,4,6],\"x\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"selected\":{\"id\":\"4848\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"4847\",\"type\":\"UnionRenderers\"}},\"id\":\"4671\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"top\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"4673\",\"type\":\"VBar\"},{\"attributes\":{\"overlay\":{\"id\":\"4664\",\"type\":\"BoxAnnotation\"}},\"id\":\"4658\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4659\",\"type\":\"SaveTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6761\\u5f62\\u56fe\"},\"id\":\"4636\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"4660\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"factors\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"id\":\"4639\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"4661\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4656\",\"type\":\"PanTool\"},{\"id\":\"4657\",\"type\":\"WheelZoomTool\"},{\"id\":\"4658\",\"type\":\"BoxZoomTool\"},{\"id\":\"4659\",\"type\":\"SaveTool\"},{\"id\":\"4660\",\"type\":\"ResetTool\"},{\"id\":\"4661\",\"type\":\"HelpTool\"}]},\"id\":\"4662\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"4641\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4664\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4643\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"4645\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"4671\",\"type\":\"ColumnDataSource\"}},\"id\":\"4675\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"\\u6c34\\u679c\",\"formatter\":{\"id\":\"4845\",\"type\":\"CategoricalTickFormatter\"},\"plot\":{\"id\":\"4637\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4648\",\"type\":\"CategoricalTicker\"}},\"id\":\"4647\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"4847\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4648\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"4848\",\"type\":\"Selection\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"4637\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4648\",\"type\":\"CategoricalTicker\"}},\"id\":\"4650\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"\\u8ba1\\u6570(\\u4e2a)\",\"formatter\":{\"id\":\"4843\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4637\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4652\",\"type\":\"BasicTicker\"}},\"id\":\"4651\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4843\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"4637\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"e8ac3669-9065-488c-9228-1832137140f3\",\"roots\":{\"4637\":\"19771810-0eea-4d1f-908c-78579468094a\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "4637"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 条形图\n",
        "fruits \u003d [\u0027苹果\u0027, \u0027梨\u0027, \u0027油桃\u0027, \u0027李子\u0027, \u0027葡萄\u0027, \u0027草莓\u0027]\n",
        "counts \u003d [5, 3, 4, 2, 4, 6]\n",
        "years \u003d [\u00272015\u0027, \u00272016\u0027, \u00272017\u0027]\n",
        "\n",
        "p \u003d figure(x_range\u003dfruits, plot_height\u003d250, title\u003d\"条形图\")\n",
        "p.vbar(x\u003dfruits, top\u003dcounts, width\u003d0.9)\n",
        "\n",
        "p.xgrid.grid_line_color \u003d None\n",
        "p.y_range.start \u003d 0\n",
        "\n",
        "p.xaxis.axis_label\u003d\u0027水果\u0027\n",
        "p.yaxis.axis_label\u003d\u0027计数(个)\u0027\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 29,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"9b53a8b8-546d-4c66-9417-9b835e9702ec\" data-root-id\u003d\"5177\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"23d3b30a-a66d-46fa-be12-201f62c1bb6e\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"5187\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"5191\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"renderers\":[{\"id\":\"5187\",\"type\":\"CategoricalAxis\"},{\"id\":\"5190\",\"type\":\"Grid\"},{\"id\":\"5191\",\"type\":\"LinearAxis\"},{\"id\":\"5195\",\"type\":\"Grid\"},{\"id\":\"5204\",\"type\":\"BoxAnnotation\"},{\"id\":\"5222\",\"type\":\"Legend\"},{\"id\":\"5214\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"5176\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"5202\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"5179\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"5183\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"5181\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"5185\",\"type\":\"LinearScale\"}},\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"5201\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"fruits\"}},\"id\":\"5213\",\"type\":\"VBar\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5196\",\"type\":\"PanTool\"},{\"id\":\"5197\",\"type\":\"WheelZoomTool\"},{\"id\":\"5198\",\"type\":\"BoxZoomTool\"},{\"id\":\"5199\",\"type\":\"SaveTool\"},{\"id\":\"5200\",\"type\":\"ResetTool\"},{\"id\":\"5201\",\"type\":\"HelpTool\"}]},\"id\":\"5202\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"end\":9},\"id\":\"5181\",\"type\":\"Range1d\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5188\",\"type\":\"CategoricalTicker\"}},\"id\":\"5190\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"field\":\"color\"},\"line_color\":{\"field\":\"color\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"fruits\"}},\"id\":\"5212\",\"type\":\"VBar\"},{\"attributes\":{\"data_source\":{\"id\":\"5175\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"5212\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5213\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"5215\",\"type\":\"CDSView\"}},\"id\":\"5214\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u5f69\\u8272\\u6761\\u5f62\\u56fe\"},\"id\":\"5176\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5196\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"color\":[\"#3288bd\",\"#99d594\",\"#e6f598\",\"#fee08b\",\"#fc8d59\",\"#d53e4f\"],\"counts\":[5,3,4,2,4,6],\"fruits\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"selected\":{\"id\":\"5412\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"5411\",\"type\":\"UnionRenderers\"}},\"id\":\"5175\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5204\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5199\",\"type\":\"SaveTool\"},{\"attributes\":{\"source\":{\"id\":\"5175\",\"type\":\"ColumnDataSource\"}},\"id\":\"5215\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5188\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"5197\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis_label\":\"\\u8ba1\\u6570(\\u4e2a)\",\"formatter\":{\"id\":\"5218\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5192\",\"type\":\"BasicTicker\"}},\"id\":\"5191\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5218\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5220\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"items\":[{\"id\":\"5223\",\"type\":\"LegendItem\"}],\"location\":\"top_center\",\"orientation\":\"horizontal\",\"plot\":{\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"5222\",\"type\":\"Legend\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5192\",\"type\":\"BasicTicker\"}},\"id\":\"5195\",\"type\":\"Grid\"},{\"attributes\":{\"label\":{\"field\":\"fruits\"},\"renderers\":[{\"id\":\"5214\",\"type\":\"GlyphRenderer\"}]},\"id\":\"5223\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"5183\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"5192\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5411\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"factors\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"id\":\"5179\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"5185\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"5204\",\"type\":\"BoxAnnotation\"}},\"id\":\"5198\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"\\u6c34\\u679c\",\"formatter\":{\"id\":\"5220\",\"type\":\"CategoricalTickFormatter\"},\"plot\":{\"id\":\"5177\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5188\",\"type\":\"CategoricalTicker\"}},\"id\":\"5187\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"5412\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"5200\",\"type\":\"ResetTool\"}],\"root_ids\":[\"5177\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"23d3b30a-a66d-46fa-be12-201f62c1bb6e\",\"roots\":{\"5177\":\"9b53a8b8-546d-4c66-9417-9b835e9702ec\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "5177"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 条形图\n",
        "# 彩色条形图\n",
        "fruits \u003d [\u0027苹果\u0027, \u0027梨\u0027, \u0027油桃\u0027, \u0027李子\u0027, \u0027葡萄\u0027, \u0027草莓\u0027]\n",
        "counts \u003d [5, 3, 4, 2, 4, 6]\n",
        "years \u003d [\u00272015\u0027, \u00272016\u0027, \u00272017\u0027]\n",
        "\n",
        "source \u003d ColumnDataSource(data\u003ddict(fruits\u003dfruits, counts\u003dcounts, color\u003dSpectral6))\n",
        "        \n",
        "p \u003d figure(x_range\u003dfruits, plot_height\u003d250, y_range\u003d(0, 9), title\u003d\u0027彩色条形图\u0027)\n",
        "p.vbar(x\u003d\u0027fruits\u0027, top\u003d\u0027counts\u0027, width\u003d0.9, color\u003d\u0027color\u0027, legend\u003d\u0027fruits\u0027, source\u003dsource)\n",
        "\n",
        "p.xgrid.grid_line_color \u003d None\n",
        "p.legend.orientation \u003d \u0027horizontal\u0027\n",
        "p.legend.location \u003d \u0027top_center\u0027\n",
        "\n",
        "p.xaxis.axis_label\u003d\u0027水果\u0027\n",
        "p.yaxis.axis_label\u003d\u0027计数(个)\u0027\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 36,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"11b7b73d-9d5b-4ba3-b1df-53494ac4856b\" data-root-id\u003d\"6805\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"04fc21bf-fc1a-4d25-a857-33a66d9f0e34\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"6815\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"6820\",\"type\":\"CategoricalAxis\"}],\"plot_height\":250,\"renderers\":[{\"id\":\"6815\",\"type\":\"LinearAxis\"},{\"id\":\"6819\",\"type\":\"Grid\"},{\"id\":\"6820\",\"type\":\"CategoricalAxis\"},{\"id\":\"6823\",\"type\":\"Grid\"},{\"id\":\"6832\",\"type\":\"BoxAnnotation\"},{\"id\":\"6857\",\"type\":\"Legend\"},{\"id\":\"6849\",\"type\":\"GlyphRenderer\"},{\"id\":\"6862\",\"type\":\"GlyphRenderer\"},{\"id\":\"6876\",\"type\":\"GlyphRenderer\"},{\"id\":\"6897\",\"type\":\"GlyphRenderer\"},{\"id\":\"6911\",\"type\":\"GlyphRenderer\"},{\"id\":\"6927\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"6804\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"6830\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"6807\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"6811\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"6809\",\"type\":\"FactorRange\"},\"y_scale\":{\"id\":\"6813\",\"type\":\"CategoricalScale\"}},\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6860\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2016\",\"nonselection_glyph\":{\"id\":\"6861\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6863\",\"type\":\"CDSView\"}},\"id\":\"6862\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6825\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"6821\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"}},\"id\":\"6863\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"6832\",\"type\":\"BoxAnnotation\"}},\"id\":\"6826\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"}},\"id\":\"6928\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"\\u6c34\\u679c\",\"formatter\":{\"id\":\"6853\",\"type\":\"CategoricalTickFormatter\"},\"plot\":{\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"6821\",\"type\":\"CategoricalTicker\"}},\"id\":\"6820\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#e34a33\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6888\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#e34a33\"},\"right\":{\"expr\":{\"id\":\"6889\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6895\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"6827\",\"type\":\"SaveTool\"},{\"attributes\":{\"plot\":{\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"6816\",\"type\":\"BasicTicker\"}},\"id\":\"6819\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6888\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6889\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6896\",\"type\":\"HBar\"},{\"attributes\":{},\"id\":\"6870\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"6828\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6895\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2015\",\"nonselection_glyph\":{\"id\":\"6896\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6898\",\"type\":\"CDSView\"}},\"id\":\"6897\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6816\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"6871\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6847\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2015\",\"nonselection_glyph\":{\"id\":\"6848\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6850\",\"type\":\"CDSView\"}},\"id\":\"6849\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"6829\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"\\u8ba1\\u6570(\\u4e2a)\",\"formatter\":{\"id\":\"6855\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"6816\",\"type\":\"BasicTicker\"}},\"id\":\"6815\",\"type\":\"LinearAxis\"},{\"attributes\":{\"label\":{\"value\":\"2016 exports\"},\"renderers\":[{\"id\":\"6862\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6872\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"2017 exports\"},\"renderers\":[{\"id\":\"6876\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6886\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"6824\",\"type\":\"PanTool\"},{\"id\":\"6825\",\"type\":\"WheelZoomTool\"},{\"id\":\"6826\",\"type\":\"BoxZoomTool\"},{\"id\":\"6827\",\"type\":\"SaveTool\"},{\"id\":\"6828\",\"type\":\"ResetTool\"},{\"id\":\"6829\",\"type\":\"HelpTool\"}]},\"id\":\"6830\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"}},\"id\":\"6898\",\"type\":\"CDSView\"},{\"attributes\":{\"fields\":[]},\"id\":\"6840\",\"type\":\"Stack\"},{\"attributes\":{},\"id\":\"6813\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"label\":{\"value\":\"2015 imports\"},\"renderers\":[{\"id\":\"6897\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6907\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_color\":{\"value\":\"#fee8c8\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6892\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#fee8c8\"},\"right\":{\"expr\":{\"id\":\"6893\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6925\",\"type\":\"HBar\"},{\"attributes\":{\"label\":{\"value\":\"2016 imports\"},\"renderers\":[{\"id\":\"6911\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6923\",\"type\":\"LegendItem\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"6832\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"value\":\"#e0f3db\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6844\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#e0f3db\"},\"right\":{\"expr\":{\"id\":\"6845\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6874\",\"type\":\"HBar\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"6821\",\"type\":\"CategoricalTicker\"}},\"id\":\"6823\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6925\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2017\",\"nonselection_glyph\":{\"id\":\"6926\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6928\",\"type\":\"CDSView\"}},\"id\":\"6927\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#fdbb84\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6890\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#fdbb84\"},\"right\":{\"expr\":{\"id\":\"6891\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6909\",\"type\":\"HBar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6844\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6845\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6875\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[\"2015\"]},\"id\":\"6842\",\"type\":\"Stack\"},{\"attributes\":{},\"id\":\"6824\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6874\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2017\",\"nonselection_glyph\":{\"id\":\"6875\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6877\",\"type\":\"CDSView\"}},\"id\":\"6876\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6890\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6891\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6910\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\"]},\"id\":\"6843\",\"type\":\"Stack\"},{\"attributes\":{\"data_source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6909\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"name\":\"2016\",\"nonselection_glyph\":{\"id\":\"6910\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"6912\",\"type\":\"CDSView\"}},\"id\":\"6911\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"}},\"id\":\"6877\",\"type\":\"CDSView\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\"]},\"id\":\"6844\",\"type\":\"Stack\"},{\"attributes\":{},\"id\":\"6811\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"6887\",\"type\":\"ColumnDataSource\"}},\"id\":\"6912\",\"type\":\"CDSView\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\",\"2017\"]},\"id\":\"6845\",\"type\":\"Stack\"},{\"attributes\":{\"fill_color\":{\"value\":\"#43a2ca\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6840\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#43a2ca\"},\"right\":{\"expr\":{\"id\":\"6841\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6847\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[]},\"id\":\"6888\",\"type\":\"Stack\"},{\"attributes\":{\"callback\":null,\"factors\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"],\"range_padding\":0.1},\"id\":\"6809\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"6921\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"end\":16,\"start\":-16},\"id\":\"6807\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"6855\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"6922\",\"type\":\"Selection\"},{\"attributes\":{\"items\":[{\"id\":\"6858\",\"type\":\"LegendItem\"},{\"id\":\"6872\",\"type\":\"LegendItem\"},{\"id\":\"6886\",\"type\":\"LegendItem\"},{\"id\":\"6907\",\"type\":\"LegendItem\"},{\"id\":\"6923\",\"type\":\"LegendItem\"},{\"id\":\"6939\",\"type\":\"LegendItem\"}],\"location\":\"center_left\",\"plot\":{\"id\":\"6805\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"6857\",\"type\":\"Legend\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6840\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6841\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6848\",\"type\":\"HBar\"},{\"attributes\":{\"callback\":null,\"data\":{\"2015\":[2,1,4,3,2,4],\"2016\":[5,3,4,2,4,6],\"2017\":[3,2,4,4,5,3],\"fruits\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"selected\":{\"id\":\"6871\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"6870\",\"type\":\"UnionRenderers\"}},\"id\":\"6839\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fields\":[\"2015\"]},\"id\":\"6889\",\"type\":\"Stack\"},{\"attributes\":{\"label\":{\"value\":\"2017 imports\"},\"renderers\":[{\"id\":\"6927\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6939\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"2015 exports\"},\"renderers\":[{\"id\":\"6849\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6858\",\"type\":\"LegendItem\"},{\"attributes\":{\"source\":{\"id\":\"6839\",\"type\":\"ColumnDataSource\"}},\"id\":\"6850\",\"type\":\"CDSView\"},{\"attributes\":{\"fields\":[\"2015\"]},\"id\":\"6890\",\"type\":\"Stack\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6892\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6893\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6926\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\"]},\"id\":\"6891\",\"type\":\"Stack\"},{\"attributes\":{},\"id\":\"6853\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6c34\\u679c\\u8fdb\\u51fa\\u53e3\\u6982\\u51b5/\\u5e74\"},\"id\":\"6804\",\"type\":\"Title\"},{\"attributes\":{\"fill_color\":{\"value\":\"#a8ddb5\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6842\",\"type\":\"Stack\"}},\"line_color\":{\"value\":\"#a8ddb5\"},\"right\":{\"expr\":{\"id\":\"6843\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6860\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[\"2015\"]},\"id\":\"6841\",\"type\":\"Stack\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\"]},\"id\":\"6892\",\"type\":\"Stack\"},{\"attributes\":{\"callback\":null,\"data\":{\"2015\":[-1,0,-1,-3,-2,-1],\"2016\":[-2,-1,-3,-1,-2,-2],\"2017\":[-1,-2,-1,0,-2,-2],\"fruits\":[\"\\u82f9\\u679c\",\"\\u68a8\",\"\\u6cb9\\u6843\",\"\\u674e\\u5b50\",\"\\u8461\\u8404\",\"\\u8349\\u8393\"]},\"selected\":{\"id\":\"6922\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"6921\",\"type\":\"UnionRenderers\"}},\"id\":\"6887\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.9},\"left\":{\"expr\":{\"id\":\"6842\",\"type\":\"Stack\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"expr\":{\"id\":\"6843\",\"type\":\"Stack\"}},\"y\":{\"field\":\"fruits\"}},\"id\":\"6861\",\"type\":\"HBar\"},{\"attributes\":{\"fields\":[\"2015\",\"2016\",\"2017\"]},\"id\":\"6893\",\"type\":\"Stack\"}],\"root_ids\":[\"6805\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"04fc21bf-fc1a-4d25-a857-33a66d9f0e34\",\"roots\":{\"6805\":\"11b7b73d-9d5b-4ba3-b1df-53494ac4856b\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "6805"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 条形图\n",
        "# 叠加条形图\n",
        "from bokeh.palettes import GnBu3, OrRd3  \n",
        "\n",
        "fruits \u003d [\u0027苹果\u0027, \u0027梨\u0027, \u0027油桃\u0027, \u0027李子\u0027, \u0027葡萄\u0027, \u0027草莓\u0027]\n",
        "counts \u003d [5, 3, 4, 2, 4, 6]\n",
        "years \u003d [\u00272015\u0027, \u00272016\u0027, \u00272017\u0027]\n",
        "\n",
        "exports \u003d {\u0027fruits\u0027 : fruits,\n",
        "           \u00272015\u0027   : [2, 1, 4, 3, 2, 4],\n",
        "           \u00272016\u0027   : [5, 3, 4, 2, 4, 6],\n",
        "           \u00272017\u0027   : [3, 2, 4, 4, 5, 3]}\n",
        "\n",
        "imports \u003d {\u0027fruits\u0027 : fruits,\n",
        "       \u00272015\u0027   : [-1, 0, -1, -3, -2, -1],\n",
        "       \u00272016\u0027   : [-2, -1, -3, -1, -2, -2],\n",
        "       \u00272017\u0027   : [-1, -2, -1, 0, -2, -2]}\n",
        "\n",
        "p \u003d figure(y_range\u003dfruits, plot_height\u003d250, x_range\u003d(-16, 16), title\u003d\u0027水果进出口概况/年\u0027)\n",
        "p.hbar_stack(years, y\u003d\u0027fruits\u0027, height\u003d0.9, color\u003dGnBu3, source\u003dColumnDataSource(exports),\n",
        "            legend\u003d[\u0027{} exports\u0027.format(x) for x in years])\n",
        "p.hbar_stack(years, y\u003d\u0027fruits\u0027, height\u003d0.9, color\u003dOrRd3, source\u003dColumnDataSource(imports),\n",
        "            legend\u003d[\u0027{} imports\u0027.format(x) for x in years])\n",
        "\n",
        "p.y_range.range_padding \u003d 0.1\n",
        "p.ygrid.grid_line_color \u003d None\n",
        "p.legend.location \u003d \u0027center_left\u0027\n",
        "\n",
        "p.yaxis.axis_label\u003d\u0027水果\u0027\n",
        "p.xaxis.axis_label\u003d\u0027计数(个)\u0027\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 37,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"670c0319-f6e4-400a-9fb8-059e42dd47a6\" data-root-id\u003d\"7236\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"63eec4f2-8ade-4b72-9711-82ad48a30cd7\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"7245\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"7249\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"renderers\":[{\"id\":\"7245\",\"type\":\"CategoricalAxis\"},{\"id\":\"7248\",\"type\":\"Grid\"},{\"id\":\"7249\",\"type\":\"LinearAxis\"},{\"id\":\"7253\",\"type\":\"Grid\"},{\"id\":\"7262\",\"type\":\"BoxAnnotation\"},{\"id\":\"7272\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"7235\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"7260\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"7234\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"7241\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"7239\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"7243\",\"type\":\"LinearScale\"}},\"id\":\"7236\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"7509\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"7257\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"7239\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"7258\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"7511\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"7241\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"7250\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"7259\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"7254\",\"type\":\"PanTool\"},{\"id\":\"7255\",\"type\":\"WheelZoomTool\"},{\"id\":\"7256\",\"type\":\"BoxZoomTool\"},{\"id\":\"7257\",\"type\":\"SaveTool\"},{\"id\":\"7258\",\"type\":\"ResetTool\"},{\"id\":\"7259\",\"type\":\"HelpTool\"}]},\"id\":\"7260\",\"type\":\"Toolbar\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6c34\\u679c\\u6309\\u5e74\\u5206\\u7ec4\\u8ba1\\u6570\"},\"id\":\"7235\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"7262\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"7233\",\"type\":\"ColumnDataSource\"}},\"id\":\"7273\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7513\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7236\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7250\",\"type\":\"BasicTicker\"}},\"id\":\"7253\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"7262\",\"type\":\"BoxAnnotation\"}},\"id\":\"7256\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"7246\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"callback\":null,\"data\":{\"counts\":[2,5,3,1,3,2,4,3,4,3,2,4,2,4,5,4,6,3],\"x\":[[\"\\u82f9\\u679c\",\"2015\"],[\"\\u82f9\\u679c\",\"2016\"],[\"\\u82f9\\u679c\",\"2017\"],[\"\\u68a8\",\"2015\"],[\"\\u68a8\",\"2016\"],[\"\\u68a8\",\"2017\"],[\"\\u6cb9\\u6843\",\"2015\"],[\"\\u6cb9\\u6843\",\"2016\"],[\"\\u6cb9\\u6843\",\"2017\"],[\"\\u674e\\u5b50\",\"2015\"],[\"\\u674e\\u5b50\",\"2016\"],[\"\\u674e\\u5b50\",\"2017\"],[\"\\u8461\\u8404\",\"2015\"],[\"\\u8461\\u8404\",\"2016\"],[\"\\u8461\\u8404\",\"2017\"],[\"\\u8349\\u8393\",\"2015\"],[\"\\u8349\\u8393\",\"2016\"],[\"\\u8349\\u8393\",\"2017\"]]},\"selected\":{\"id\":\"7514\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"7513\",\"type\":\"UnionRenderers\"}},\"id\":\"7233\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"7255\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"7254\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"7233\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7270\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7271\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"7273\",\"type\":\"CDSView\"}},\"id\":\"7272\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"\\u6c34\\u679c\",\"formatter\":{\"id\":\"7511\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":1,\"plot\":{\"id\":\"7236\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7246\",\"type\":\"CategoricalTicker\"}},\"id\":\"7245\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"7270\",\"type\":\"VBar\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"\\u82f9\\u679c\",\"2015\"],[\"\\u82f9\\u679c\",\"2016\"],[\"\\u82f9\\u679c\",\"2017\"],[\"\\u68a8\",\"2015\"],[\"\\u68a8\",\"2016\"],[\"\\u68a8\",\"2017\"],[\"\\u6cb9\\u6843\",\"2015\"],[\"\\u6cb9\\u6843\",\"2016\"],[\"\\u6cb9\\u6843\",\"2017\"],[\"\\u674e\\u5b50\",\"2015\"],[\"\\u674e\\u5b50\",\"2016\"],[\"\\u674e\\u5b50\",\"2017\"],[\"\\u8461\\u8404\",\"2015\"],[\"\\u8461\\u8404\",\"2016\"],[\"\\u8461\\u8404\",\"2017\"],[\"\\u8349\\u8393\",\"2015\"],[\"\\u8349\\u8393\",\"2016\"],[\"\\u8349\\u8393\",\"2017\"]],\"range_padding\":0.1},\"id\":\"7234\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"7243\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"7514\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"7271\",\"type\":\"VBar\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"7236\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7246\",\"type\":\"CategoricalTicker\"}},\"id\":\"7248\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"\\u8ba1\\u6570(\\u4e2a)\",\"formatter\":{\"id\":\"7509\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7236\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7250\",\"type\":\"BasicTicker\"}},\"id\":\"7249\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"7236\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"63eec4f2-8ade-4b72-9711-82ad48a30cd7\",\"roots\":{\"7236\":\"670c0319-f6e4-400a-9fb8-059e42dd47a6\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "7236"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 条形图\n",
        "# 分组条形图\n",
        "from bokeh.models import FactorRange\n",
        "\n",
        "fruits \u003d [\u0027苹果\u0027, \u0027梨\u0027, \u0027油桃\u0027, \u0027李子\u0027, \u0027葡萄\u0027, \u0027草莓\u0027]\n",
        "counts \u003d [5, 3, 4, 2, 4, 6]\n",
        "years \u003d [\u00272015\u0027, \u00272016\u0027, \u00272017\u0027]\n",
        "\n",
        "data \u003d {\u0027fruits\u0027 : fruits,\n",
        "        \u00272015\u0027   : [2, 1, 4, 3, 2, 4],\n",
        "        \u00272016\u0027   : [5, 3, 3, 2, 4, 6],\n",
        "        \u00272017\u0027   : [3, 2, 4, 4, 5, 3]}\n",
        "        \n",
        "x \u003d [(fruit, year) for fruit in fruits for year in years]\n",
        "counts \u003d sum(zip(data[\u00272015\u0027], data[\u00272016\u0027], data[\u00272017\u0027]), ())  # like hstack，3年合并\n",
        "\n",
        "source \u003d ColumnDataSource(data\u003ddict(x\u003dx, counts\u003dcounts))\n",
        "p \u003d figure(x_range\u003dFactorRange(*x), plot_height\u003d250, title\u003d\u0027水果按年分组计数\u0027)\n",
        "\n",
        "p.vbar(x\u003d\u0027x\u0027, top\u003d\u0027counts\u0027, width\u003d0.9, source\u003dsource)\n",
        "\n",
        "p.y_range.start \u003d 0\n",
        "p.x_range.range_padding \u003d 0.1\n",
        "p.xaxis.major_label_orientation \u003d 1\n",
        "p.xgrid.grid_line_color \u003d None\n",
        "\n",
        "p.xaxis.axis_label\u003d\u0027水果\u0027\n",
        "p.yaxis.axis_label\u003d\u0027计数(个)\u0027\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 38,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"07b3a968-8a61-41e6-9d58-84cb88eb3ac1\" data-root-id\u003d\"7566\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"9e9685ab-714c-4584-b54f-bc64ccfb8223\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"7575\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"7579\",\"type\":\"LinearAxis\"}],\"plot_height\":250,\"renderers\":[{\"id\":\"7575\",\"type\":\"CategoricalAxis\"},{\"id\":\"7578\",\"type\":\"Grid\"},{\"id\":\"7579\",\"type\":\"LinearAxis\"},{\"id\":\"7583\",\"type\":\"Grid\"},{\"id\":\"7592\",\"type\":\"BoxAnnotation\"},{\"id\":\"7603\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"7565\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"7590\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"7564\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"7571\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"7569\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"7573\",\"type\":\"LinearScale\"}},\"id\":\"7566\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"7584\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"7585\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"counts\":[2,5,3,1,3,2,4,3,4,3,2,4,2,4,5,4,6,3],\"x\":[[\"\\u82f9\\u679c\",\"2015\"],[\"\\u82f9\\u679c\",\"2016\"],[\"\\u82f9\\u679c\",\"2017\"],[\"\\u68a8\",\"2015\"],[\"\\u68a8\",\"2016\"],[\"\\u68a8\",\"2017\"],[\"\\u6cb9\\u6843\",\"2015\"],[\"\\u6cb9\\u6843\",\"2016\"],[\"\\u6cb9\\u6843\",\"2017\"],[\"\\u674e\\u5b50\",\"2015\"],[\"\\u674e\\u5b50\",\"2016\"],[\"\\u674e\\u5b50\",\"2017\"],[\"\\u8461\\u8404\",\"2015\"],[\"\\u8461\\u8404\",\"2016\"],[\"\\u8461\\u8404\",\"2017\"],[\"\\u8349\\u8393\",\"2015\"],[\"\\u8349\\u8393\",\"2016\"],[\"\\u8349\\u8393\",\"2017\"]]},\"selected\":{\"id\":\"7853\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"7852\",\"type\":\"UnionRenderers\"}},\"id\":\"7563\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"7592\",\"type\":\"BoxAnnotation\"}},\"id\":\"7586\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"\\u82f9\\u679c\",\"2015\"],[\"\\u82f9\\u679c\",\"2016\"],[\"\\u82f9\\u679c\",\"2017\"],[\"\\u68a8\",\"2015\"],[\"\\u68a8\",\"2016\"],[\"\\u68a8\",\"2017\"],[\"\\u6cb9\\u6843\",\"2015\"],[\"\\u6cb9\\u6843\",\"2016\"],[\"\\u6cb9\\u6843\",\"2017\"],[\"\\u674e\\u5b50\",\"2015\"],[\"\\u674e\\u5b50\",\"2016\"],[\"\\u674e\\u5b50\",\"2017\"],[\"\\u8461\\u8404\",\"2015\"],[\"\\u8461\\u8404\",\"2016\"],[\"\\u8461\\u8404\",\"2017\"],[\"\\u8349\\u8393\",\"2015\"],[\"\\u8349\\u8393\",\"2016\"],[\"\\u8349\\u8393\",\"2017\"]],\"range_padding\":0.1},\"id\":\"7564\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"7587\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"7588\",\"type\":\"ResetTool\"},{\"attributes\":{\"end\":2,\"factors\":[\"2015\",\"2016\",\"2017\"],\"palette\":[\"firebrick\",\"olive\",\"navy\"],\"start\":1},\"id\":\"7599\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"7848\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"7589\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\\u6c34\\u679c\\u6309\\u5e74\\u5206\\u7ec4\\u8ba1\\u6570\"},\"id\":\"7565\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"7584\",\"type\":\"PanTool\"},{\"id\":\"7585\",\"type\":\"WheelZoomTool\"},{\"id\":\"7586\",\"type\":\"BoxZoomTool\"},{\"id\":\"7587\",\"type\":\"SaveTool\"},{\"id\":\"7588\",\"type\":\"ResetTool\"},{\"id\":\"7589\",\"type\":\"HelpTool\"}]},\"id\":\"7590\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"7602\",\"type\":\"VBar\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"7569\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"7571\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"7592\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"7573\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"7563\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7601\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7602\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"7604\",\"type\":\"CDSView\"}},\"id\":\"7603\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"\\u6c34\\u679c\",\"formatter\":{\"id\":\"7850\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":1,\"plot\":{\"id\":\"7566\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7576\",\"type\":\"CategoricalTicker\"}},\"id\":\"7575\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"source\":{\"id\":\"7563\",\"type\":\"ColumnDataSource\"}},\"id\":\"7604\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7576\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"7852\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"7566\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7576\",\"type\":\"CategoricalTicker\"}},\"id\":\"7578\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"\\u8ba1\\u6570(\\u4e2a)\",\"formatter\":{\"id\":\"7848\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7566\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7580\",\"type\":\"BasicTicker\"}},\"id\":\"7579\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"7580\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"7850\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7566\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7580\",\"type\":\"BasicTicker\"}},\"id\":\"7583\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":{\"field\":\"x\",\"transform\":{\"id\":\"7599\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"value\":\"white\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.9},\"x\":{\"field\":\"x\"}},\"id\":\"7601\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"7853\",\"type\":\"Selection\"}],\"root_ids\":[\"7566\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"9e9685ab-714c-4584-b54f-bc64ccfb8223\",\"roots\":{\"7566\":\"07b3a968-8a61-41e6-9d58-84cb88eb3ac1\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "7566"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 条形图\n",
        "# 彩色分组条形图\n",
        "from bokeh.transform import factor_cmap\n",
        "\n",
        "fruits \u003d [\u0027苹果\u0027, \u0027梨\u0027, \u0027油桃\u0027, \u0027李子\u0027, \u0027葡萄\u0027, \u0027草莓\u0027]\n",
        "counts \u003d [5, 3, 4, 2, 4, 6]\n",
        "years \u003d [\u00272015\u0027, \u00272016\u0027, \u00272017\u0027]\n",
        "\n",
        "data \u003d {\u0027fruits\u0027 : fruits,\n",
        "        \u00272015\u0027   : [2, 1, 4, 3, 2, 4],\n",
        "        \u00272016\u0027   : [5, 3, 3, 2, 4, 6],\n",
        "        \u00272017\u0027   : [3, 2, 4, 4, 5, 3]}\n",
        "        \n",
        "x \u003d [(fruit, year) for fruit in fruits for year in years]\n",
        "counts \u003d sum(zip(data[\u00272015\u0027], data[\u00272016\u0027], data[\u00272017\u0027]), ())  # like hstack，3年合并\n",
        "\n",
        "source \u003d ColumnDataSource(data\u003ddict(x\u003dx, counts\u003dcounts))\n",
        "p \u003d figure(x_range\u003dFactorRange(*x), plot_height\u003d250, title\u003d\u0027水果按年分组计数\u0027)\n",
        "\n",
        "p.vbar(x\u003d\u0027x\u0027, top\u003d\u0027counts\u0027, width\u003d0.9, source\u003dsource, line_color\u003d\u0027white\u0027,\n",
        "      fill_color\u003dfactor_cmap(\u0027x\u0027, palette\u003d[\u0027firebrick\u0027, \u0027olive\u0027, \u0027navy\u0027], factors\u003dyears, start\u003d1, end\u003d2))\n",
        "\n",
        "p.y_range.start \u003d 0\n",
        "p.x_range.range_padding \u003d 0.1\n",
        "p.xaxis.major_label_orientation \u003d 1\n",
        "p.xgrid.grid_line_color \u003d None\n",
        "\n",
        "p.xaxis.axis_label\u003d\u0027水果\u0027\n",
        "p.yaxis.axis_label\u003d\u0027计数(个)\u0027\n",
        "\n",
        "show(p)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 40,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"cf242a21-abfd-4c48-b673-7ccb5861ee90\" data-root-id\u003d\"8324\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"dbf3a30b-a888-4cca-b561-19f7d193d73f\":{\"roots\":{\"references\":[{\"attributes\":{\"renderers\":[{\"id\":\"8329\",\"type\":\"GraphRenderer\"}],\"title\":{\"id\":\"8614\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"8615\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"8322\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"8617\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"8323\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"8616\",\"type\":\"LinearScale\"}},\"id\":\"8324\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"8323\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"8618\",\"type\":\"NodesOnly\"},{\"attributes\":{\"data_source\":{\"id\":\"8335\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8334\",\"type\":\"MultiLine\"},\"hover_glyph\":null,\"muted_glyph\":null,\"view\":{\"id\":\"8337\",\"type\":\"CDSView\"}},\"id\":\"8336\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"orange\"},\"size\":{\"units\":\"screen\",\"value\":20}},\"id\":\"8330\",\"type\":\"Circle\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\"},\"id\":\"8615\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"8631\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"8627\",\"type\":\"NodesOnly\"},{\"attributes\":{\"data_source\":{\"id\":\"8331\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8330\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"view\":{\"id\":\"8333\",\"type\":\"CDSView\"}},\"id\":\"8332\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"8322\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]},\"selected\":{\"id\":\"8631\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"8630\",\"type\":\"UnionRenderers\"}},\"id\":\"8331\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"8628\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"edge_renderer\":{\"id\":\"8336\",\"type\":\"GlyphRenderer\"},\"inspection_policy\":{\"id\":\"8627\",\"type\":\"NodesOnly\"},\"layout_provider\":{\"id\":\"8338\",\"type\":\"StaticLayoutProvider\"},\"node_renderer\":{\"id\":\"8332\",\"type\":\"GlyphRenderer\"},\"selection_policy\":{\"id\":\"8618\",\"type\":\"NodesOnly\"}},\"id\":\"8329\",\"type\":\"GraphRenderer\"},{\"attributes\":{},\"id\":\"8630\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"8335\",\"type\":\"ColumnDataSource\"}},\"id\":\"8337\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"8614\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"data\":{\"end\":[1,19,5,2,16,3,11,4,14,5,9,6,7,15,8,18,9,13,10,11,19,12,13,17,14,15,16,17,18,19],\"start\":[0,0,0,1,1,2,2,3,3,4,4,5,6,6,7,7,8,8,9,10,10,11,12,12,13,14,15,16,17,18]},\"selected\":{\"id\":\"8629\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"8628\",\"type\":\"UnionRenderers\"}},\"id\":\"8335\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"8616\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_dash\":[2,2]},\"id\":\"8334\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"8629\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"8331\",\"type\":\"ColumnDataSource\"}},\"id\":\"8333\",\"type\":\"CDSView\"},{\"attributes\":{\"graph_layout\":{\"0\":[0.1509277442012661,-0.14360936093259222],\"1\":[1.3539190943629424,-0.5137000277544815],\"10\":[-0.8797162283477145,-0.07255259435726437],\"11\":[0.316531271131307,-0.47782037694934937],\"12\":[0.7102447315335635,0.6499319829129069],\"13\":[-0.11878387904816869,0.17844710999775387],\"14\":[0.42660694230888807,-0.8959099307298558],\"15\":[0.8532436315883063,0.07091909063064808],\"16\":[1.6756602260973825,0.49832851979279125],\"17\":[1.1272359737026323,1.4501203942188121],\"18\":[0.03549600791358778,1.8],\"19\":[-0.38599798712028477,0.9113802102094254],\"2\":[0.8818462263003358,-1.411380386325415],\"3\":[-0.01797434499909268,-1.7925667428120355],\"4\":[-1.1098577738836446,-1.4635602915731185],\"5\":[-0.7130456899446307,-0.6525768834519823],\"6\":[-0.39776367203850094,0.44549968813576146],\"7\":[-0.8911765974210507,1.412108752588609],\"8\":[-1.3435128715454374,0.5165402965804541],\"9\":[-1.673882804791685,-0.5095994501810637]}},\"id\":\"8338\",\"type\":\"StaticLayoutProvider\"},{\"attributes\":{},\"id\":\"8617\",\"type\":\"LinearScale\"}],\"root_ids\":[\"8324\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"dbf3a30b-a888-4cca-b561-19f7d193d73f\",\"roots\":{\"8324\":\"cf242a21-abfd-4c48-b673-7ccb5861ee90\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "8324"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# 网络图\n",
        "import networkx as nx\n",
        "from bokeh.models import Range1d, Plot\n",
        "from bokeh.models.graphs import from_networkx\n",
        "\n",
        "G \u003d nx.desargues_graph()\n",
        "\n",
        "plot \u003d Plot(x_range\u003dRange1d(-2, 2), y_range\u003dRange1d(-2, 2))\n",
        "\n",
        "graph \u003d from_networkx(G, nx.spring_layout, scale\u003d1.8, center\u003d(0, 0))\n",
        "plot.renderers.append(graph)\n",
        "\n",
        "graph.node_renderer.glyph.update(size\u003d20, fill_color\u003d\u0027orange\u0027)\n",
        "graph.edge_renderer.glyph.line_dash \u003d [2, 2]\n",
        "\n",
        "show(plot)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 43,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"f0238667-8e6f-430a-9fb7-692ad98ec7e7\" data-root-id\u003d\"8820\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"d88b847a-c4e2-4b5f-9ac0-10f863281555\":{\"roots\":{\"references\":[{\"attributes\":{\"renderers\":[{\"id\":\"8825\",\"type\":\"GraphRenderer\"}],\"title\":{\"id\":\"9134\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"8848\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"8818\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"9137\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"8819\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"9136\",\"type\":\"LinearScale\"}},\"id\":\"8820\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"9151\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"8831\",\"type\":\"ColumnDataSource\"}},\"id\":\"8833\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"9149\",\"type\":\"Selection\"},{\"attributes\":{\"graph_layout\":{\"0\":[-0.7133522635641311,1.096122733401108],\"1\":[-0.5432666720564441,0.05085062416201213],\"10\":[-0.35886214128897664,1.6835881595387268],\"11\":[-0.21170258684784393,0.587801305437576],\"12\":[-0.4683086256365367,-0.7790906539441015],\"13\":[0.7198073762031599,-1.1025083659249817],\"14\":[1.4903308197349985,-1.3192606633733643],\"15\":[0.35563216035649164,-1.6753545278147057],\"16\":[-0.7807866923196239,-1.3362662062300141],\"17\":[-1.5935988204812148,-0.9398474291978628],\"18\":[-1.8,0.12380989321840594],\"19\":[-1.4805720626965015,1.3302869817224239],\"2\":[0.7009175107388037,0.30857185703642187],\"3\":[1.794028498059437,-0.12276108724994066],\"4\":[1.60255057038721,0.943506607792024],\"5\":[0.46868042724754416,0.7860242264575629],\"6\":[0.20895586241464498,-0.581376465680935],\"7\":[-0.7284075760981304,-0.31040742185991943],\"8\":[0.5459545661159414,-0.06844863186220898],\"9\":[0.7919996497311683,1.3247590643717713]}},\"id\":\"8834\",\"type\":\"StaticLayoutProvider\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"8818\",\"type\":\"Range1d\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"9134\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"9148\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"edge_renderer\":{\"id\":\"8832\",\"type\":\"GlyphRenderer\"},\"inspection_policy\":{\"id\":\"9147\",\"type\":\"NodesOnly\"},\"layout_provider\":{\"id\":\"8834\",\"type\":\"StaticLayoutProvider\"},\"node_renderer\":{\"id\":\"8828\",\"type\":\"GlyphRenderer\"},\"selection_policy\":{\"id\":\"9138\",\"type\":\"NodesOnly\"}},\"id\":\"8825\",\"type\":\"GraphRenderer\"},{\"attributes\":{\"callback\":null,\"tooltips\":\"index: @index\"},\"id\":\"8847\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"9147\",\"type\":\"NodesOnly\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"8847\",\"type\":\"HoverTool\"}]},\"id\":\"8848\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_color\":{\"field\":\"colors\"},\"size\":{\"units\":\"screen\",\"value\":20}},\"id\":\"8826\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"8819\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"9136\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null,\"data\":{\"colors\":[\"#1f77b4\",\"#aec7e8\",\"#ff7f0e\",\"#ffbb78\",\"#2ca02c\",\"#98df8a\",\"#d62728\",\"#ff9896\",\"#9467bd\",\"#c5b0d5\",\"#8c564b\",\"#c49c94\",\"#e377c2\",\"#f7b6d2\",\"#7f7f7f\",\"#c7c7c7\",\"#bcbd22\",\"#dbdb8d\",\"#17becf\",\"#9edae5\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]},\"selected\":{\"id\":\"9151\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"9150\",\"type\":\"UnionRenderers\"}},\"id\":\"8827\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"8827\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8826\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"view\":{\"id\":\"8829\",\"type\":\"CDSView\"}},\"id\":\"8828\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"9137\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"8827\",\"type\":\"ColumnDataSource\"}},\"id\":\"8829\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"8830\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"9138\",\"type\":\"NodesOnly\"},{\"attributes\":{\"data_source\":{\"id\":\"8831\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8830\",\"type\":\"MultiLine\"},\"hover_glyph\":null,\"muted_glyph\":null,\"view\":{\"id\":\"8833\",\"type\":\"CDSView\"}},\"id\":\"8832\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"data\":{\"end\":[1,19,5,2,16,3,11,4,14,5,9,6,7,15,8,18,9,13,10,11,19,12,13,17,14,15,16,17,18,19],\"start\":[0,0,0,1,1,2,2,3,3,4,4,5,6,6,7,7,8,8,9,10,10,11,12,12,13,14,15,16,17,18]},\"selected\":{\"id\":\"9149\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"9148\",\"type\":\"UnionRenderers\"}},\"id\":\"8831\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"9150\",\"type\":\"UnionRenderers\"}],\"root_ids\":[\"8820\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"d88b847a-c4e2-4b5f-9ac0-10f863281555\",\"roots\":{\"8820\":\"f0238667-8e6f-430a-9fb7-692ad98ec7e7\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "8820"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "from bokeh.models import HoverTool\n",
        "from bokeh.palettes import Category20_20\n",
        "\n",
        "G \u003d nx.desargues_graph()\n",
        "\n",
        "plot \u003d Plot(x_range\u003dRange1d(-2, 2), y_range\u003dRange1d(-2, 2))\n",
        "\n",
        "graph \u003d from_networkx(G, nx.spring_layout, scale\u003d1.8, center\u003d(0, 0))\n",
        "plot.renderers.append(graph)\n",
        "\n",
        "graph.node_renderer.data_source.data[\u0027index\u0027] \u003d list(range(len(G)))\n",
        "graph.node_renderer.data_source.data[\u0027colors\u0027] \u003d Category20_20\n",
        "\n",
        "graph.node_renderer.glyph.update(size\u003d20, fill_color\u003d\u0027colors\u0027)\n",
        "\n",
        "plot.add_tools(HoverTool(tooltips\u003d\u0027index: @index\u0027))\n",
        "\n",
        "show(plot)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 61,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "\n",
              "  \u003cdiv class\u003d\"bk-root\" id\u003d\"68f87510-34e8-4271-831d-ee6382229546\" data-root-id\u003d\"14380\"\u003e\u003c/div\u003e\n"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/javascript": [
              "(function(root) {\n",
              "  function embed_document(root) {\n",
              "    \n",
              "  var docs_json \u003d {\"f6b26e1e-9dd8-46d2-a57a-ebc66792dbef\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"14379\",\"type\":\"WidgetBox\"},{\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"14380\",\"type\":\"Column\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"14373\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"14374\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"14798\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"14348\",\"type\":\"BasicTicker\"}},\"id\":\"14347\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"14353\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"14339\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"14337\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"14373\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"14374\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"14376\",\"type\":\"CDSView\"}},\"id\":\"14375\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"14345\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"14796\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"14365\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"children\":[{\"id\":\"14377\",\"type\":\"Slider\"}]},\"id\":\"14379\",\"type\":\"WidgetBox\"},{\"attributes\":{},\"id\":\"14798\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"14357\",\"type\":\"PanTool\"},{\"id\":\"14358\",\"type\":\"WheelZoomTool\"},{\"id\":\"14359\",\"type\":\"BoxZoomTool\"},{\"id\":\"14360\",\"type\":\"SaveTool\"},{\"id\":\"14361\",\"type\":\"ResetTool\"},{\"id\":\"14362\",\"type\":\"HelpTool\"}]},\"id\":\"14363\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null},\"id\":\"14341\",\"type\":\"DataRange1d\"},{\"attributes\":{\"args\":{\"slider\":{\"id\":\"14377\",\"type\":\"Slider\"},\"source\":{\"id\":\"14337\",\"type\":\"ColumnDataSource\"}},\"code\":\"\\n    var data \u003d source.data;\\n    var f \u003d slider.value;\\n    x \u003d data[\u0027x\u0027];\\n    y \u003d data[\u0027y\u0027];\\n    for (i \u003d 0; i \u003c x.length; i++){\\n        y[i] \u003d Math.pow(x[i], f);\\n    }\\n    \\n    source.change.emit();\\n    \"},\"id\":\"14378\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"14343\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"14362\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"14361\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"end\":6,\"js_property_callbacks\":{\"change:value\":[{\"id\":\"14378\",\"type\":\"CustomJS\"}]},\"start\":0.1,\"step\":0.1,\"title\":\"power\",\"value\":1},\"id\":\"14377\",\"type\":\"Slider\"},{\"attributes\":{},\"id\":\"14360\",\"type\":\"SaveTool\"},{\"attributes\":{\"overlay\":{\"id\":\"14365\",\"type\":\"BoxAnnotation\"}},\"id\":\"14359\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"14337\",\"type\":\"ColumnDataSource\"}},\"id\":\"14376\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"14358\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"14357\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"14801\",\"type\":\"Selection\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"14793\",\"type\":\"Title\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"14353\",\"type\":\"BasicTicker\"}},\"id\":\"14356\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"14348\",\"type\":\"BasicTicker\"}},\"id\":\"14351\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"14800\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"below\":[{\"id\":\"14347\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"14352\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"14347\",\"type\":\"LinearAxis\"},{\"id\":\"14351\",\"type\":\"Grid\"},{\"id\":\"14352\",\"type\":\"LinearAxis\"},{\"id\":\"14356\",\"type\":\"Grid\"},{\"id\":\"14365\",\"type\":\"BoxAnnotation\"},{\"id\":\"14375\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"14793\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"14363\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"14339\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"14343\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"14341\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"14345\",\"type\":\"LinearScale\"}},\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0],\"y\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0]},\"selected\":{\"id\":\"14801\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"14800\",\"type\":\"UnionRenderers\"}},\"id\":\"14337\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"formatter\":{\"id\":\"14796\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"14338\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"14353\",\"type\":\"BasicTicker\"}},\"id\":\"14352\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"14348\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"14380\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.4\"}};\n",
              "  var render_items \u003d [{\"docid\":\"f6b26e1e-9dd8-46d2-a57a-ebc66792dbef\",\"roots\":{\"14380\":\"68f87510-34e8-4271-831d-ee6382229546\"}}];\n",
              "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
              "\n",
              "  }\n",
              "  if (root.Bokeh !\u003d\u003d undefined) {\n",
              "    embed_document(root);\n",
              "  } else {\n",
              "    var attempts \u003d 0;\n",
              "    var timer \u003d setInterval(function(root) {\n",
              "      if (root.Bokeh !\u003d\u003d undefined) {\n",
              "        embed_document(root);\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "      attempts++;\n",
              "      if (attempts \u003e 100) {\n",
              "        console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
              "        clearInterval(timer);\n",
              "      }\n",
              "    }, 10, root)\n",
              "  }\n",
              "})(window);"
            ],
            "application/vnd.bokehjs_exec.v0+json": ""
          },
          "metadata": {
            "application/vnd.bokehjs_exec.v0+json": {
              "id": "14380"
            }
          },
          "output_type": "display_data"
        }
      ],
      "source": [
        "# Slider widget example\n",
        "from bokeh.layouts import column\n",
        "from bokeh.models import CustomJS, ColumnDataSource, Slider\n",
        "\n",
        "x \u003d [a * 0.005 for a in range(201)]\n",
        "\n",
        "source \u003d ColumnDataSource(data\u003ddict(x\u003dx, y\u003dx))\n",
        "\n",
        "plot \u003d figure(plot_width\u003d400, plot_height\u003d400)\n",
        "plot.line(\u0027x\u0027, \u0027y\u0027, source\u003dsource, line_width\u003d3, line_alpha\u003d0.6)\n",
        "\n",
        "# Slider\n",
        "slider \u003d Slider(start\u003d0.1, end\u003d6, value\u003d1, step\u003d0.1, title\u003d\u0027power\u0027)\n",
        "\n",
        "update_curve \u003d CustomJS(args\u003ddict(source\u003dsource, slider\u003dslider), code\u003d\"\"\"\n",
        "    var data \u003d source.data;\n",
        "    var f \u003d slider.value;\n",
        "    x \u003d data[\u0027x\u0027];\n",
        "    y \u003d data[\u0027y\u0027];\n",
        "    for (i \u003d 0; i \u003c x.length; i++){\n",
        "        y[i] \u003d Math.pow(x[i], f);\n",
        "    }\n",
        "    \n",
        "    source.change.emit();\n",
        "    \"\"\")\n",
        "\n",
        "slider.js_on_change(\u0027value\u0027, update_curve)\n",
        "\n",
        "# show(plot)\n",
        "show(column(slider, plot))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "pycharm": {}
      },
      "outputs": [],
      "source": []
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 2
}